Subversion Repositories SmartDukaan

Rev

Rev 21480 | Rev 22381 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21480 Rev 22133
Line 67... Line 67...
67
    @Override
67
    @Override
68
    protected void onCreate(Bundle savedInstanceState) {
68
    protected void onCreate(Bundle savedInstanceState) {
69
        TestinAgent.init(this);
69
        TestinAgent.init(this);
70
        super.onCreate(savedInstanceState);
70
        super.onCreate(savedInstanceState);
71
        setContentView(R.layout.activity_splash_screen);
71
        setContentView(R.layout.activity_splash_screen);
72
        getSupportActionBar().hide();
72
        GIFView gifImageView = (GIFView) findViewById(R.id.gif);
-
 
73
        gifImageView.setGifImageResource(R.drawable.progressbar);
73
        userData = getApplicationContext().getSharedPreferences("User_Data", MODE_PRIVATE);
74
        userData = getApplicationContext().getSharedPreferences("User_Data", MODE_PRIVATE);
74
        apkData = getApplicationContext().getSharedPreferences("APK_Data", MODE_PRIVATE);
75
        apkData = getApplicationContext().getSharedPreferences("APK_Data", MODE_PRIVATE);
75
        apiData = getApplicationContext().getSharedPreferences("API_Data", MODE_PRIVATE);
76
        apiData = getApplicationContext().getSharedPreferences("API_Data", MODE_PRIVATE);
76
        apkDataEditor = apkData.edit();
77
        apkDataEditor = apkData.edit();
77
        userEditor = userData.edit();
78
        userEditor = userData.edit();
Line 373... Line 374...
373
        @Override
374
        @Override
374
        protected String doInBackground(String... arg0) {
375
        protected String doInBackground(String... arg0) {
375
            try {
376
            try {
376
                HttpClient httpclient = new DefaultHttpClient();
377
                HttpClient httpclient = new DefaultHttpClient();
377
                HttpPost httppost = new HttpPost("http://api.profittill.com/devices/add");
378
                HttpPost httppost = new HttpPost("http://api.profittill.com/devices/add");
-
 
379
                //HttpPost httppost = new HttpPost(ProfitTillConstants.Push_Url);
378
                httppost.setHeader("Authorization", ProfitTillConstants.BASIC_AUTH);
380
                httppost.setHeader("Authorization", ProfitTillConstants.BASIC_AUTH);
379
                httppost.setEntity(new UrlEncodedFormEntity(apkDataListValue));
381
                httppost.setEntity(new UrlEncodedFormEntity(apkDataListValue));
380
                HttpResponse response = httpclient.execute(httppost);
382
                HttpResponse response = httpclient.execute(httppost);
381
                HttpEntity entity = response.getEntity();
383
                HttpEntity entity = response.getEntity();
382
                int status = response.getStatusLine().getStatusCode();
384
                int status = response.getStatusLine().getStatusCode();
Line 396... Line 398...
396
 
398
 
397
        }
399
        }
398
        @Override
400
        @Override
399
        protected void onPostExecute(String result) {
401
        protected void onPostExecute(String result) {
400
            super.onPostExecute(result);
402
            super.onPostExecute(result);
401
         }
403
        }
402
    }
404
    }
403
 
405
 
404
 
406
 
405
    public final boolean isInternetOn() {
407
    public final boolean isInternetOn() {
406
 
408
 
Line 462... Line 464...
462
        protected String doInBackground(String... arg0) {
464
        protected String doInBackground(String... arg0) {
463
            String id = null;
465
            String id = null;
464
            try {
466
            try {
465
                HttpClient httpclient = new DefaultHttpClient();
467
                HttpClient httpclient = new DefaultHttpClient();
466
                HttpPost httppost = new HttpPost(apiData.getString("gcm.push.url", "http://api.profittill.com/gcm_users/add"));
468
                HttpPost httppost = new HttpPost(apiData.getString("gcm.push.url", "http://api.profittill.com/gcm_users/add"));
-
 
469
                //HttpPost httppost = new HttpPost(ProfitTillConstants.gcm_url);
467
                nameValuePairsGcm = new ArrayList<>();
470
                nameValuePairsGcm = new ArrayList<>();
468
                TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
471
                TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
469
                nameValuePairsGcm.add(new BasicNameValuePair("gcm_regid", regId));
472
                nameValuePairsGcm.add(new BasicNameValuePair("gcm_regid", regId));
470
                nameValuePairsGcm.add(new BasicNameValuePair("imeinumber", telephonyManager.getDeviceId()));
473
                nameValuePairsGcm.add(new BasicNameValuePair("imeinumber", telephonyManager.getDeviceId()));
471
                nameValuePairsGcm.add(new BasicNameValuePair("user_id", userData.getString("id", null)));
474
                nameValuePairsGcm.add(new BasicNameValuePair("user_id", userData.getString("id", null)));