forked from hussien89aa/AndroidTutorialForBeginners
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hussienalrubaye
committed
Sep 27, 2016
1 parent
a7a438c
commit e2c47ed
Showing
8 changed files
with
120 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
MyTracker/app/src/main/java/com/alrubaye/mytracker/RunithOS.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.alrubaye.mytracker; | ||
|
||
import android.content.BroadcastReceiver; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.location.LocationManager; | ||
|
||
/** | ||
* Created by hussienalrubaye on 9/26/16. | ||
*/ | ||
|
||
public class RunithOS extends BroadcastReceiver { | ||
|
||
|
||
@Override | ||
public void onReceive(Context context, Intent intent) { | ||
|
||
if (intent.getAction().equalsIgnoreCase("android.intent.action.BOOT_COMPLETED")){ | ||
GlobalInfo globalInfo= new GlobalInfo(context); | ||
globalInfo.LoadData(); | ||
//start location track | ||
if (!TrackLocation.isRunning){ | ||
TrackLocation trackLocation = new TrackLocation(); | ||
LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); | ||
|
||
lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, trackLocation); | ||
} | ||
if (!MyServie.IsRunning){ | ||
Intent intent1=new Intent(context,MyServie.class); | ||
context.startService(intent1); | ||
} | ||
} | ||
} | ||
} |