Ejemplo n.º 1
0
 RemoveMessageTask(MosaicService callback, Long id) {
   this.callback = callback;
   this.id = id;
   Mosaicmessages.Builder endpointBuilder =
       new Mosaicmessages.Builder(transport, jsonFactory, credential);
   endpoint = CloudEndpointUtils.updateBuilder(endpointBuilder).build();
 }
Ejemplo n.º 2
0
 UpdateMessageTask(MosaicService callback, MosaicMessage message) {
   this.callback = callback;
   this.message = message;
   Mosaicmessages.Builder endpointBuilder =
       new Mosaicmessages.Builder(transport, jsonFactory, credential);
   endpoint = CloudEndpointUtils.updateBuilder(endpointBuilder).build();
 }
Ejemplo n.º 3
0
 GetMessagesTask(MosaicService callback, int latitude, int longitude) {
   this.callback = callback;
   this.latitude = latitude;
   this.longitude = longitude;
   Mosaicmessages.Builder endpointBuilder =
       new Mosaicmessages.Builder(transport, jsonFactory, credential);
   endpoint = CloudEndpointUtils.updateBuilder(endpointBuilder).build();
 }
Ejemplo n.º 4
0
 public GCMIntentService() {
   super(PROJECT_ID);
   Builder endpointBuilder =
       new Deviceinfoendpoint.Builder(
           AndroidHttp.newCompatibleTransport(),
           new JacksonFactory(),
           new HttpRequestInitializer() {
             public void initialize(HttpRequest httpRequest) {}
           });
   endpoint = CloudEndpointUtils.updateBuilder(endpointBuilder).build();
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    preferences = PreferenceManager.getDefaultSharedPreferences(this);

    Advogadoendpoint.Builder endpointBuilder =
        new Advogadoendpoint.Builder(
            AndroidHttp.newCompatibleTransport(),
            new JacksonFactory(),
            new HttpRequestInitializer() {
              public void initialize(HttpRequest httpRequest) {}
            });
    advogadoEndpoint = CloudEndpointUtils.updateBuilder(endpointBuilder).build();
    setContentView(R.layout.activity_login);

    String email = preferences.getString(PreferencesActivity.PREFS_KEY_EMAIL, "");

    if (email == null || email.trim().length() == 0) {
      // Set up the login form.
      mEmail = getIntent().getStringExtra(EXTRA_EMAIL);
      mEmailView = (EditText) findViewById(R.id.email);
      mEmailView.setText(mEmail);

      mPasswordView = (EditText) findViewById(R.id.password);
      mPasswordView.setOnEditorActionListener(
          new TextView.OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
              if (id == R.id.login || id == EditorInfo.IME_NULL) {
                attemptLogin();
                return true;
              }
              return false;
            }
          });

      mLoginFormView = findViewById(R.id.login_form);
      mLoginStatusView = findViewById(R.id.login_status);
      mLoginStatusMessageView = (TextView) findViewById(R.id.login_status_message);
      mLoginButtonView = (Button) findViewById(R.id.sign_in_button);
      mLoginButtonView.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View view) {
              attemptLogin();
            }
          });
    } else {
      Intent intent = new Intent();
      intent.setClass(this, MainActivity.class);
      startActivity(intent);
      finish();
    }
  }
    @Override
    protected CollectionResponseBinType doInBackground(Void... params) {

      BinTypeApi.Builder endpointBuilder =
          new BinTypeApi.Builder(AndroidHttp.newCompatibleTransport(), new JacksonFactory(), null);
      endpointBuilder = CloudEndpointUtils.updateBuilder(endpointBuilder);
      BinTypeApi BinTypeApiService = endpointBuilder.build();

      try {
        return BinTypeApiService.list().execute();
      } catch (IOException e) {
        Log.w(TAG, e);
        return null;
      }
    }
 /**
  * Retrieves the list of recommendations through appropriate CloudEndpoint.
  *
  * @param params the place for which to retrieve recommendations.
  * @return collection of retrieved recommendations.
  */
 @Override
 protected CollectionResponseRecommendation doInBackground(Place... params) {
   Recommendationendpoint.Builder endpointBuilder =
       new Recommendationendpoint.Builder(
           AndroidHttp.newCompatibleTransport(), new JacksonFactory(), null);
   endpointBuilder = CloudEndpointUtils.updateBuilder(endpointBuilder);
   CollectionResponseRecommendation result;
   Recommendationendpoint endpoint = endpointBuilder.build();
   try {
     result = endpoint.listRecommendation().execute();
   } catch (IOException e) {
     e.printStackTrace();
     result = null;
   }
   return result;
 }
    @Override
    protected CollectionResponseBrand doInBackground(Void... params) {

      BrandApi.Builder endpointBuilder =
          new BrandApi.Builder(AndroidHttp.newCompatibleTransport(), new JacksonFactory(), null);
      endpointBuilder = CloudEndpointUtils.updateBuilder(endpointBuilder);
      BrandApi brandApiService = endpointBuilder.build();

      try {
        // Number of brands limited to 1000 possible. Edit this value to increase/decrease
        return brandApiService.list().setLimit(1000).execute();
      } catch (IOException e) {
        Log.w(TAG, e);
        return null;
      }
    }
Ejemplo n.º 9
0
 UpdateUserTask(MosaicService callback) {
   this.callback = callback;
   Mosaicusers.Builder endpointBuilder =
       new Mosaicusers.Builder(transport, jsonFactory, credential);
   endpoint = CloudEndpointUtils.updateBuilder(endpointBuilder).build();
 }