Android Open Source - spotastop Registration Service

From Project

Back to project page spotastop.


The source code is released under:

MIT License

If you think the Android project spotastop listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*from  ww  w. j  a  v a  2s  . c  o m*/
import java.util.ArrayList;

import requests.Criteria;
import resources.Resource;
import rest.RestApi;
import android.content.Intent;
import android.os.IBinder;

import com.cipciop.spotastop.StopSpotApp;
import com.cipciop.spotastop.domain.User;

public class RegistrationService extends Service {

  public IBinder onBind(Intent arg0) {
    return null;

  public int onStartCommand(Intent intent, int flags, int startid) {
    new Thread(new Runnable() {
      public void run() {
        User newUser = new User();
        Criteria c = new Criteria();
        c.addConstraint("resClass", "cipciop\\spotastop\\User");
        c.addConstraint("username", StopSpotApp.getInstance()

        ArrayList<Resource> users = RestApi.queryResources(c);
        if (users.size() == 0) {
          c.addConstraint("resClass", "cipciop\\spotastop\\User");
          c.addConstraint("username", StopSpotApp.getInstance()

          users = RestApi.queryResources(c);
          if (users.size() > 0) {
            if (((User) users.get(0))
                    .getInsertedUsername(), StopSpotApp
                    .getInstance().getInsertedPassword())) {
                  (User) users.get(0));

    return 0;

Java Source Code List