Skip to content

rovkinmax/IndependentTime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IndependentTime

Use

  • Import library module in your project
  • add permission
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
  • add receiver in to your AndroidManifest.xml
 <receiver android:name="com.useit.independenttime.TimeReceiver" >
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"/>
                <action android:name="android.intent.action.ACTION_SHUTDOWN"/>
                <action android:name="com.useit.independenttime.ACTION_TO_UPDATE_TIME"/>
            </intent-filter>
  </receiver>
  • Set or update server time
final long someServerTime = System.currentTimeMillis();//or get time from your server
IndependentTimeHelper.setServerTime(this, someServerTime);
  • Get updated local time
final long localTime = IndependentTimeHelper.getTime(this);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages