Пример #1
0
  @Override
  public void onCreate() {
    super.onCreate();
    Parse.initialize(this, PARSE_APPLICATION_ID, PARSE_CLIENT_KEY);

    ParseUser.enableAutomaticUser();
    ParseACL defaultACL = new ParseACL();
    // Optionally enable public read access.
    defaultACL.setPublicReadAccess(true);
    ParseACL.setDefaultACL(defaultACL, true);

    PushService.subscribe(this, "", PushActivity.class);
    PushService.setDefaultPushCallback(this, PushActivity.class);

    // ParseObject o = new ParseObject("Installation");
    // o.saveInBackground();
  }
 @Override
 public void onCreate() {
   super.onCreate();
   // For creating the parse backend
   // Refer to parse docs
   Parse.initialize(
       this,
       "oQd6qUkCFtmFJdARTufcyctRAACDrhoSbSRFn2XK",
       "fH0mDVS5iIBRvNmz8CBCfgXTJD6JSPCjGOL9AXdj");
   // For Push Notification
   PushService.setDefaultPushCallback(this, MainActivity.class);
 }
Пример #3
0
  @Override
  public void onCreate() {
    super.onCreate();
    ParseCrashReporting.enable(this);
    Parse.enableLocalDatastore(this);
    Parse.initialize(this, getString(R.string.ApplicationID), getString(R.string.Client_ID));
    // This allows read access to all objects
    PushService.setDefaultPushCallback(this, LoginActivity.class);
    ParseUser.enableAutomaticUser();
    ParseACL defaultACL = new ParseACL();

    // If you would like all objects to be private by default, remove this line.
    defaultACL.setPublicReadAccess(true);

    ParseACL.setDefaultACL(defaultACL, true);
  }
Пример #4
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    signup = (Button) findViewById(R.id.signup);
    login = (Button) findViewById(R.id.Login);
    username = (EditText) findViewById(R.id.username);
    PWD = (EditText) findViewById(R.id.PWD);

    Parse.initialize(this, AppId, ClientID);

    // To track statistics around application
    ParseAnalytics.trackAppOpened(getIntent());

    // inform the Parse Cloud that it is ready for notifications
    PushService.setDefaultPushCallback(this, MainActivity.class);
    ParseInstallation.getCurrentInstallation().saveInBackground();

    signup.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View arg0) {
            // TODO Auto-generated method stub
            Intent intentSignUP = new Intent(getApplicationContext(), signup.class);
            startActivity(intentSignUP);
            username.setText("");
            PWD.setText("");
          }
        });

    login.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            Boolean flag = validate();
          }
        });
  }
Пример #5
0
  @Override
  public void onCreate() {
    super.onCreate();

    // Add your initialization code here
    Parse.initialize(
        this,
        "QtZp32q9GfvXr9dISg1bHLiRCPUAQupJuvVLUR4A",
        "W55RAUhxQlpfQW43SeTQPvFxuJuIaupbpvrLRFxD");

    // ParseUser.enableAutomaticUser();
    ParseACL defaultACL = new ParseACL();

    // If you would like all objects to be private by default, remove this line.
    defaultACL.setPublicReadAccess(true);
    defaultACL.setPublicWriteAccess(true);
    ParseACL.setDefaultACL(defaultACL, true);

    // Call PostCheckIn activity when a push notification is recieved
    PushService.setDefaultPushCallback(this, PostCheckIn.class);
    ParseInstallation.getCurrentInstallation().saveInBackground();
  }
  /**
   * When created, the application fires an intent to create the AllJoyn service. This acts as sort
   * of a combined view/controller in the overall architecture.
   */
  public void onCreate() {
    Log.i(TAG, "onCreate()");
    // setup parse
    ParseObject.registerSubclass(Device.class);
    ParseObject.registerSubclass(Group.class);
    ParseObject.registerSubclass(Media.class);

    Parse.initialize(
        this,
        "nrXYlTqKzxmp0mSynnblthvX5HcwdNykXTNoekWs",
        "lNCLSapoIIUCVylghKSR0lT4Gvb78FEo7kjHToSd");
    Parse.setLogLevel(Parse.LOG_LEVEL_VERBOSE);
    PushService.startServiceIfRequired(getBaseContext());
    ParseACL defaultACL = new ParseACL();
    defaultACL.setPublicReadAccess(true);
    ParseACL.setDefaultACL(defaultACL, true);

    PACKAGE_NAME = getApplicationContext().getPackageName();
    Intent intent = new Intent(this, AllJoynService.class);
    mRunningService = startService(intent);
    if (mRunningService == null) {
      Log.i(TAG, "onCreate(): failed to startService()");
    }
  }
Пример #7
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    if (savedInstanceState == null) {
      getSupportFragmentManager()
          .beginTransaction()
          .add(R.id.container, new PlaceholderFragment())
          .commit();
    }

    Parse.initialize(
        this,
        "6czlHkRsjdXw9FoXfyClFEdEIkPX7EhACbkGK5XW",
        "hSh8DbBdolFtw8hdOfyHf7sYZ3ekEllmg9c047Fc");

    ParseObject testObject = new ParseObject("TestObject");
    testObject.put("foo", "bar");
    testObject.saveInBackground();

    PushService.setDefaultPushCallback(this, MainActivity.class);
    ParseInstallation.getCurrentInstallation().saveInBackground();
  }
Пример #8
0
  @SuppressLint("NewApi")
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_home_screen);

    // initialize Parse for backend/cloud support
    Parse.initialize(
        this,
        "PUXTA9zRvdwXpCDMa1U8ErnSCPjQmHSvu2cdvMPG",
        "QIOJXwayIAQ2kfYDe7iw0yGfbFI8KGKejOiXoioM");

    // testing Parse funcionality
    ParseObject testObject = new ParseObject("TestObject");
    testObject.put("foo", "bar");
    testObject.saveInBackground();

    // defining default activity to handle push notifications
    PushService.setDefaultPushCallback(this, HomeScreen.class);
    ParseInstallation.getCurrentInstallation().saveInBackground();

    // initializing database
    DatabaseHelper dbHelper = new DatabaseHelper(this);

    Log.d(HOMESCREEN, "Inserting Schedule Items to Table");
    // TODO: Add Loading Spinner until this process is complete
    //      and/or start a new thread to Handle this
    // initializing Schedule Table and
    // inserting all items into schedule Table
    for (int i = 0; i < ((startTimesArray.length) - 1); i++) {
      scheduleItem =
          new ScheduleItem(
              startTimesArray[i],
              endTimesArray[i],
              panelTitleArray[i],
              panelDescriptionArray[i],
              speakersArray[i],
              locationArray[i]);

      // Inserting ScheduleItems to Database
      Log.d(HOMESCREEN, "Inserting Master Schedule Items");
      // Log.d(HOMESCREEN, ((startTimesArray.length)-1).toString());
      Log.d(HOMESCREEN, scheduleItem.getStartTime().toString());
      Log.d(HOMESCREEN, scheduleItem.getPanelTitle().toString());
      schedItem_id = dbHelper.createScheduleItem(scheduleItem, null);
    }

    /** ***************inserting into my_schedule table******************* */
    /*
    //initializing database
    DatabaseHelper dbHelper2 = new DatabaseHelper(this);

    Log.d(HOMESCREEN,"Inserting Schedule Items to Table");
    //TODO: Add Loading Spinner until this process is complete
    //      and/or start a new thread to Handle this
    //initializing Schedule Table and
    //inserting all items into schedule Table
    for (int i=0; i<3; i++){
    	my_scheduleItem = new MyScheduleItem(startTimesArray[i],
    			endTimesArray[i],
    			panelTitleArray[i],
    			panelDescriptionArray[i],
    			speakersArray[i],
    			locationArray[i]);

    	// Inserting ScheduleItems to Database
        Log.d(HOMESCREEN, "Inserting Master Schedule Items");
        //Log.d(HOMESCREEN, ((startTimesArray.length)-1).toString());
        Log.d(HOMESCREEN, my_scheduleItem.getStartTime().toString());
        Log.d(HOMESCREEN, my_scheduleItem.getPanelTitle().toString());
        schedItem_id = dbHelper2.createMyScheduleItem(my_scheduleItem, null);
    }
    */
    /** ***************************************************************** */

    // Initialization
    viewPager = (ViewPager) findViewById(R.id.pager);
    actionBar = getActionBar();
    mAdapter = new TabsPagerAdapter(getSupportFragmentManager());

    viewPager.setAdapter(mAdapter);
    actionBar.setHomeButtonEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

    // Adding Tabs
    for (String tab_name : tabs) {
      actionBar.addTab(actionBar.newTab().setText(tab_name).setTabListener(this));
    }

    /*select_item = (ImageButton) findViewById(R.id.feedback_thumbnail);
    select_item.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Toast.makeText(HomeScreen.this, "Item Added to MySchedule", Toast.LENGTH_SHORT).show();
        }
    });*/

    viewPager.setOnPageChangeListener(
        new ViewPager.OnPageChangeListener() {

          @Override
          public void onPageSelected(int position) {
            // on changing the page
            // make respected tab selected
            actionBar.setSelectedNavigationItem(position);
          }

          @Override
          public void onPageScrolled(int arg0, float arg1, int arg2) {}

          @Override
          public void onPageScrollStateChanged(int arg0) {}
        });
  }
Пример #9
0
 public void start(Activity activity) {
   PushService.setDefaultPushCallback(
       activity.getApplicationContext(), HomeActivity.class, R.drawable.icon);
   ParseInstallation.getCurrentInstallation().saveInBackground();
 }