LocatonManager and telephonyManager
<p>I am currently working on an app which enhances the mobile security. I am using location Manager to determine the location of the phone using GPS. Also i am using telephony manager to detect the change of sim. These two things i have done in two separate .java files as two activities. Here is my code</p>

<p>one activity:</p>

<pre><code>LocationManager locationManager = (LocationManager)this.getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_COARSE); 
String bestProvider= locationManager.getBestProvider(criteria, true);
Location loc = locationManager.getLastKnownLocation(bestProvider);
Toast Toast1=Toast.makeText(getBaseContext(),"The location is"+(CharSequence) loc,Toast.LENGTH_LONG);
Toast1.show();
Intent startServiceIntent=new Intent();
startServiceIntent.setClass(getApplicationContext(),sim.class);
startService(startServiceIntent);
</code></pre>

<p>another activity:</p>

<pre><code>TelephonyManager tMgr=(TelephonyManager)mAppContext.getSystemService(Context.TELEPHONY_SERVICE);
    String mPhoneNumber = tMgr.getLine1Number();
    Toast myToast=Toast.makeText(getBaseContext(),"sim changed and new number is"+(CharSequence) mPhoneNumber,Toast.LENGTH_LONG);
    myToast.show();
</code></pre>

<p>As i cannot check this with the emulator is my code right?
will it work?</p>
