Are you over 18 and want to see adult content?
More Annotations
![A complete backup of seankingston.com](https://www.archivebay.com/archive5/images/c2c8ab11-84c4-4c82-94b6-056a86538b18.png)
A complete backup of seankingston.com
Are you over 18 and want to see adult content?
![A complete backup of zipperstudio.com](https://www.archivebay.com/archive5/images/598c3d48-d956-45d8-a484-8a57fdb353a7.png)
A complete backup of zipperstudio.com
Are you over 18 and want to see adult content?
Favourite Annotations
![A complete backup of haufe-akademie.de](https://www.archivebay.com/archive2/5648838e-ee39-42c1-90af-81ccf68f7725.png)
A complete backup of haufe-akademie.de
Are you over 18 and want to see adult content?
![A complete backup of prestigemotorsport.com.au](https://www.archivebay.com/archive2/a7114c2f-3a7c-4f39-ac8d-7aadb2f46d7e.png)
A complete backup of prestigemotorsport.com.au
Are you over 18 and want to see adult content?
![A complete backup of newsiesthemusical.com](https://www.archivebay.com/archive2/cc2c747c-a10b-41ac-b52f-38989007b7a4.png)
A complete backup of newsiesthemusical.com
Are you over 18 and want to see adult content?
![A complete backup of p-paradise.com.tw](https://www.archivebay.com/archive2/88229e41-09dd-4da8-b98f-389b9eed7210.png)
A complete backup of p-paradise.com.tw
Are you over 18 and want to see adult content?
![A complete backup of kestrelgames.com](https://www.archivebay.com/archive2/c3c2e9a1-db6c-483a-8e55-e3a771d9d058.png)
A complete backup of kestrelgames.com
Are you over 18 and want to see adult content?
Text
MUYA'S CODEPATH
Use startForeground. Use the startForeground(int, Notification) API to put the service in a foreground state, where the system considers it to be something the user is actively aware of and thus not a candidate for killing when low on memory. (It is still theoretically possible for the service to be killed under extreme memory pressure from the current foreground application, but in practiceCONTEXT TRICK
12345678910public class MyApplication extends Application { private static Context context; @Override public void onCreate() { context = HOW TO PREVENT OUR SERVICES OF ANDROID APP FROM BEING Create 2 services to protect each other. they will restart the other service when it was killed. Remain 1px size page in the foreground to stay in a foreground state when application goes to background. Make your app as a system app by changing the proper permissions in a rooted device. Contact manufacturer.TAG: ANDROID
Note: Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. 01-24 . Note: Custom Views for Android ANDROID BETTER PRACTICE : ACTIVITY Knowing info of current activity12345678public class BaseActivity extends Activity { private final String TAG = getClass().getSimpleName(); @Override protected void GENYMOTION WINDOW REMAIN BLACK In this case: Run VirtualBox. Open File > Preferences > Network (or VirtualBox > Preferences for Mac OS X). Edit the Host-only Network by clicking . Check that the adapter IPv4 address is in the same network (192.168.56.0/24 by default) as the DHCP server address, lower address bound and upper address bound. If not, your virtual device cannot NOTE: STREAMLINING ANDROID APPS: ELIMINATING CODE OVERHEAD Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. This talk will focus on techniques that both libraries and applications can implement to ensure their effect is in generalwithout overhead.
NOTE: CUSTOM VIEWS FOR ANDROID Google I/O 2013 - Writing Custom Views for Android Custom Views and Performance (100 Days of Google Dev) ANDROID: HOW TO UPDATE YOUR DB OF APP IN A GOOD WAY 1234567891011121314151617181920212223242526272829303132333435public class MyDatabaseHelper extends SQLiteOpenHelper { //version 1 public static final String CREATE HOW TO CHECK ORIENTATION OF YOUR ANDROID DEVICE IN …TRANSLATE THISPAGE
整理转载自ticktick 在对应的activity中,重载函数onConfigurationChanged1234@Overridepublic voidonConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig);} 在该函数中可以通过两种方法检测当前MUYA'S CODEPATH
Use startForeground. Use the startForeground(int, Notification) API to put the service in a foreground state, where the system considers it to be something the user is actively aware of and thus not a candidate for killing when low on memory. (It is still theoretically possible for the service to be killed under extreme memory pressure from the current foreground application, but in practiceCONTEXT TRICK
12345678910public class MyApplication extends Application { private static Context context; @Override public void onCreate() { context = HOW TO PREVENT OUR SERVICES OF ANDROID APP FROM BEING Create 2 services to protect each other. they will restart the other service when it was killed. Remain 1px size page in the foreground to stay in a foreground state when application goes to background. Make your app as a system app by changing the proper permissions in a rooted device. Contact manufacturer.TAG: ANDROID
Note: Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. 01-24 . Note: Custom Views for Android ANDROID BETTER PRACTICE : ACTIVITY Knowing info of current activity12345678public class BaseActivity extends Activity { private final String TAG = getClass().getSimpleName(); @Override protected void GENYMOTION WINDOW REMAIN BLACK In this case: Run VirtualBox. Open File > Preferences > Network (or VirtualBox > Preferences for Mac OS X). Edit the Host-only Network by clicking . Check that the adapter IPv4 address is in the same network (192.168.56.0/24 by default) as the DHCP server address, lower address bound and upper address bound. If not, your virtual device cannot NOTE: STREAMLINING ANDROID APPS: ELIMINATING CODE OVERHEAD Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. This talk will focus on techniques that both libraries and applications can implement to ensure their effect is in generalwithout overhead.
NOTE: CUSTOM VIEWS FOR ANDROID Google I/O 2013 - Writing Custom Views for Android Custom Views and Performance (100 Days of Google Dev) ANDROID: HOW TO UPDATE YOUR DB OF APP IN A GOOD WAY 1234567891011121314151617181920212223242526272829303132333435public class MyDatabaseHelper extends SQLiteOpenHelper { //version 1 public static final String CREATE HOW TO CHECK ORIENTATION OF YOUR ANDROID DEVICE IN …TRANSLATE THISPAGE
整理转载自ticktick 在对应的activity中,重载函数onConfigurationChanged1234@Overridepublic voidonConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig);} 在该函数中可以通过两种方法检测当前 HOW TO CHECK ORIENTATION OF YOUR ANDROID DEVICE IN …TRANSLATE THISPAGE
整理转载自ticktick 在对应的activity中,重载函数onConfigurationChanged1234@Overridepublic voidonConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig);} 在该函数中可以通过两种方法检测当前 MUYA'S CODEPATHTRANSLATE THIS PAGE Knowing info of current activity. 1 2 3 4 5 6 7 8: public class BaseActivity extends Activity { private final String TAG = getClass().getSimpleName(); @Override HOW TO TRACK OPEN STATUS OF AN E-MAIL Improve stability : Using combo “script + noscript” #JavaScript.Announcement
ABOUT SINGLETON
推荐实现方式1234567891011121314public class Singleton { // Private constructor suppresses private Singleton() { } private static class LazyHolder { static finaMUYA'S CODEPATH
Use startForeground. Use the startForeground(int, Notification) API to put the service in a foreground state, where the system considers it to be something the user is actively aware of and thus not a candidate for killing when low on memory. (It is still theoretically possible for the service to be killed under extreme memory pressure from the current foreground application, but in practice HOW TO PREVENT OUR SERVICES OF ANDROID APP FROM BEINGAUTHOR: LEONARDLIN
Create 2 services to protect each other. they will restart the other service when it was killed. Remain 1px size page in the foreground to stay in a foreground state when application goes to background. Make your app as a system app by changing the proper permissions in a rooted device. Contact manufacturer.TAG: ANDROID
Note: Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. 01-24 . Note: Custom Views for Android GENYMOTION WINDOW REMAIN BLACK In this case: Run VirtualBox. Open File > Preferences > Network (or VirtualBox > Preferences for Mac OS X). Edit the Host-only Network by clicking . Check that the adapter IPv4 address is in the same network (192.168.56.0/24 by default) as the DHCP server address, lower address bound and upper address bound. If not, your virtual device cannotCONTEXT TRICK
12345678910public class MyApplication extends Application { private static Context context; @Override public void onCreate() { context = ANDROID BETTER PRACTICE : ACTIVITY Knowing info of current activity12345678public class BaseActivity extends Activity { private final String TAG = getClass().getSimpleName(); @Override protected void NOTE: STREAMLINING ANDROID APPS: ELIMINATING CODE OVERHEAD Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. This talk will focus on techniques that both libraries and applications can implement to ensure their effect is in generalwithout overhead.
NOTE: CUSTOM VIEWS FOR ANDROID Google I/O 2013 - Writing Custom Views for Android Custom Views and Performance (100 Days of Google Dev) ANDROID: HOW TO UPDATE YOUR DB OF APP IN A GOOD WAY 1234567891011121314151617181920212223242526272829303132333435public class MyDatabaseHelper extends SQLiteOpenHelper { //version 1 public static final String CREATE HOW TO CHECK ORIENTATION OF YOUR ANDROID DEVICE IN …TRANSLATE THISPAGE
整理转载自ticktick 在对应的activity中,重载函数onConfigurationChanged1234@Overridepublic voidonConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig);} 在该函数中可以通过两种方法检测当前MUYA'S CODEPATH
Use startForeground. Use the startForeground(int, Notification) API to put the service in a foreground state, where the system considers it to be something the user is actively aware of and thus not a candidate for killing when low on memory. (It is still theoretically possible for the service to be killed under extreme memory pressure from the current foreground application, but in practiceCONTEXT TRICK
12345678910public class MyApplication extends Application { private static Context context; @Override public void onCreate() { context = HOW TO PREVENT OUR SERVICES OF ANDROID APP FROM BEING Create 2 services to protect each other. they will restart the other service when it was killed. Remain 1px size page in the foreground to stay in a foreground state when application goes to background. Make your app as a system app by changing the proper permissions in a rooted device. Contact manufacturer.TAG: ANDROID
Note: Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. 01-24 . Note: Custom Views for Android ANDROID BETTER PRACTICE : ACTIVITY Knowing info of current activity12345678public class BaseActivity extends Activity { private final String TAG = getClass().getSimpleName(); @Override protected void GENYMOTION WINDOW REMAIN BLACK In this case: Run VirtualBox. Open File > Preferences > Network (or VirtualBox > Preferences for Mac OS X). Edit the Host-only Network by clicking . Check that the adapter IPv4 address is in the same network (192.168.56.0/24 by default) as the DHCP server address, lower address bound and upper address bound. If not, your virtual device cannot NOTE: STREAMLINING ANDROID APPS: ELIMINATING CODE OVERHEAD Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. This talk will focus on techniques that both libraries and applications can implement to ensure their effect is in generalwithout overhead.
NOTE: CUSTOM VIEWS FOR ANDROID Google I/O 2013 - Writing Custom Views for Android Custom Views and Performance (100 Days of Google Dev) ANDROID: HOW TO UPDATE YOUR DB OF APP IN A GOOD WAY 1234567891011121314151617181920212223242526272829303132333435public class MyDatabaseHelper extends SQLiteOpenHelper { //version 1 public static final String CREATE HOW TO CHECK ORIENTATION OF YOUR ANDROID DEVICE IN …TRANSLATE THISPAGE
整理转载自ticktick 在对应的activity中,重载函数onConfigurationChanged1234@Overridepublic voidonConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig);} 在该函数中可以通过两种方法检测当前 HOW TO CHECK ORIENTATION OF YOUR ANDROID DEVICE IN …TRANSLATE THISPAGE
整理转载自ticktick 在对应的activity中,重载函数onConfigurationChanged1234@Overridepublic voidonConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig);} 在该函数中可以通过两种方法检测当前 MUYA'S CODEPATHTRANSLATE THIS PAGE Knowing info of current activity. 1 2 3 4 5 6 7 8: public class BaseActivity extends Activity { private final String TAG = getClass().getSimpleName(); @Override HOW TO TRACK OPEN STATUS OF AN E-MAIL Improve stability : Using combo “script + noscript” #JavaScript.Announcement
ABOUT SINGLETON
推荐实现方式1234567891011121314public class Singleton { // Private constructor suppresses private Singleton() { } private static class LazyHolder { static finaMUYA'S CODEPATH
Use startForeground. Use the startForeground(int, Notification) API to put the service in a foreground state, where the system considers it to be something the user is actively aware of and thus not a candidate for killing when low on memory. (It is still theoretically possible for the service to be killed under extreme memory pressure from the current foreground application, but in practice HOW TO PREVENT OUR SERVICES OF ANDROID APP FROM BEINGAUTHOR: LEONARDLIN
Create 2 services to protect each other. they will restart the other service when it was killed. Remain 1px size page in the foreground to stay in a foreground state when application goes to background. Make your app as a system app by changing the proper permissions in a rooted device. Contact manufacturer.TAG: ANDROID
Note: Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. 01-24 . Note: Custom Views for Android GENYMOTION WINDOW REMAIN BLACK In this case: Run VirtualBox. Open File > Preferences > Network (or VirtualBox > Preferences for Mac OS X). Edit the Host-only Network by clicking . Check that the adapter IPv4 address is in the same network (192.168.56.0/24 by default) as the DHCP server address, lower address bound and upper address bound. If not, your virtual device cannotCONTEXT TRICK
12345678910public class MyApplication extends Application { private static Context context; @Override public void onCreate() { context = ANDROID BETTER PRACTICE : ACTIVITY Knowing info of current activity12345678public class BaseActivity extends Activity { private final String TAG = getClass().getSimpleName(); @Override protected void NOTE: STREAMLINING ANDROID APPS: ELIMINATING CODE OVERHEAD Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. This talk will focus on techniques that both libraries and applications can implement to ensure their effect is in generalwithout overhead.
NOTE: CUSTOM VIEWS FOR ANDROID Google I/O 2013 - Writing Custom Views for Android Custom Views and Performance (100 Days of Google Dev) ANDROID: HOW TO UPDATE YOUR DB OF APP IN A GOOD WAY 1234567891011121314151617181920212223242526272829303132333435public class MyDatabaseHelper extends SQLiteOpenHelper { //version 1 public static final String CREATE HOW TO CHECK ORIENTATION OF YOUR ANDROID DEVICE IN …TRANSLATE THISPAGE
整理转载自ticktick 在对应的activity中,重载函数onConfigurationChanged1234@Overridepublic voidonConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig);} 在该函数中可以通过两种方法检测当前MUYA'S CODEPATH
Use startForeground. Use the startForeground(int, Notification) API to put the service in a foreground state, where the system considers it to be something the user is actively aware of and thus not a candidate for killing when low on memory. (It is still theoretically possible for the service to be killed under extreme memory pressure from the current foreground application, but in practice HOW TO PREVENT OUR SERVICES OF ANDROID APP FROM BEINGAUTHOR: LEONARDLIN
Create 2 services to protect each other. they will restart the other service when it was killed. Remain 1px size page in the foreground to stay in a foreground state when application goes to background. Make your app as a system app by changing the proper permissions in a rooted device. Contact manufacturer.TAG: ANDROID
Note: Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. 01-24 . Note: Custom Views for Android GENYMOTION WINDOW REMAIN BLACK In this case: Run VirtualBox. Open File > Preferences > Network (or VirtualBox > Preferences for Mac OS X). Edit the Host-only Network by clicking . Check that the adapter IPv4 address is in the same network (192.168.56.0/24 by default) as the DHCP server address, lower address bound and upper address bound. If not, your virtual device cannotCONTEXT TRICK
12345678910public class MyApplication extends Application { private static Context context; @Override public void onCreate() { context = ANDROID BETTER PRACTICE : ACTIVITY Knowing info of current activity12345678public class BaseActivity extends Activity { private final String TAG = getClass().getSimpleName(); @Override protected void NOTE: STREAMLINING ANDROID APPS: ELIMINATING CODE OVERHEAD Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. This talk will focus on techniques that both libraries and applications can implement to ensure their effect is in generalwithout overhead.
NOTE: CUSTOM VIEWS FOR ANDROID Google I/O 2013 - Writing Custom Views for Android Custom Views and Performance (100 Days of Google Dev) ANDROID: HOW TO UPDATE YOUR DB OF APP IN A GOOD WAY 1234567891011121314151617181920212223242526272829303132333435public class MyDatabaseHelper extends SQLiteOpenHelper { //version 1 public static final String CREATE HOW TO CHECK ORIENTATION OF YOUR ANDROID DEVICE IN …TRANSLATE THISPAGE
整理转载自ticktick 在对应的activity中,重载函数onConfigurationChanged1234@Overridepublic voidonConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig);} 在该函数中可以通过两种方法检测当前 HOW TO CHECK ORIENTATION OF YOUR ANDROID DEVICE IN …TRANSLATE THISPAGE
整理转载自ticktick 在对应的activity中,重载函数onConfigurationChanged1234@Overridepublic voidonConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig);} 在该函数中可以通过两种方法检测当前 MUYA'S CODEPATHTRANSLATE THIS PAGE Knowing info of current activity. 1 2 3 4 5 6 7 8: public class BaseActivity extends Activity { private final String TAG = getClass().getSimpleName(); @Override HOW TO TRACK OPEN STATUS OF AN E-MAIL Improve stability : Using combo “script + noscript” #JavaScript.Announcement
ABOUT SINGLETON
推荐实现方式1234567891011121314public class Singleton { // Private constructor suppresses private Singleton() { } private static class LazyHolder { static finaMUYA'S CODEPATH
Use startForeground. Use the startForeground(int, Notification) API to put the service in a foreground state, where the system considers it to be something the user is actively aware of and thus not a candidate for killing when low on memory. (It is still theoretically possible for the service to be killed under extreme memory pressure from the current foreground application, but in practice HOW TO PREVENT OUR SERVICES OF ANDROID APP FROM BEINGAUTHOR: LEONARDLIN
Create 2 services to protect each other. they will restart the other service when it was killed. Remain 1px size page in the foreground to stay in a foreground state when application goes to background. Make your app as a system app by changing the proper permissions in a rooted device. Contact manufacturer.CONTEXT TRICK
12345678910public class MyApplication extends Application { private static Context context; @Override public void onCreate() { context =TAG: ANDROID
Note: Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. 01-24 . Note: Custom Views for Android GENYMOTION WINDOW REMAIN BLACK In this case: Run VirtualBox. Open File > Preferences > Network (or VirtualBox > Preferences for Mac OS X). Edit the Host-only Network by clicking . Check that the adapter IPv4 address is in the same network (192.168.56.0/24 by default) as the DHCP server address, lower address bound and upper address bound. If not, your virtual device cannot ANDROID BETTER PRACTICE : ACTIVITY Knowing info of current activity12345678public class BaseActivity extends Activity { private final String TAG = getClass().getSimpleName(); @Override protected void NOTE: STREAMLINING ANDROID APPS: ELIMINATING CODE OVERHEAD Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. This talk will focus on techniques that both libraries and applications can implement to ensure their effect is in generalwithout overhead.
NOTE: CUSTOM VIEWS FOR ANDROID Google I/O 2013 - Writing Custom Views for Android Custom Views and Performance (100 Days of Google Dev) HOW TO CHECK ORIENTATION OF YOUR ANDROID DEVICE IN …TRANSLATE THISPAGE
整理转载自ticktick 在对应的activity中,重载函数onConfigurationChanged1234@Overridepublic voidonConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig);} 在该函数中可以通过两种方法检测当前 ANDROID: HOW TO UPDATE YOUR DB OF APP IN A GOOD WAY 1234567891011121314151617181920212223242526272829303132333435public class MyDatabaseHelper extends SQLiteOpenHelper { //version 1 public static final String CREATEMUYA'S CODEPATH
Use startForeground. Use the startForeground(int, Notification) API to put the service in a foreground state, where the system considers it to be something the user is actively aware of and thus not a candidate for killing when low on memory. (It is still theoretically possible for the service to be killed under extreme memory pressure from the current foreground application, but in practice HOW TO PREVENT OUR SERVICES OF ANDROID APP FROM BEINGAUTHOR: LEONARDLIN
Create 2 services to protect each other. they will restart the other service when it was killed. Remain 1px size page in the foreground to stay in a foreground state when application goes to background. Make your app as a system app by changing the proper permissions in a rooted device. Contact manufacturer.CONTEXT TRICK
12345678910public class MyApplication extends Application { private static Context context; @Override public void onCreate() { context =TAG: ANDROID
Note: Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. 01-24 . Note: Custom Views for Android GENYMOTION WINDOW REMAIN BLACK In this case: Run VirtualBox. Open File > Preferences > Network (or VirtualBox > Preferences for Mac OS X). Edit the Host-only Network by clicking . Check that the adapter IPv4 address is in the same network (192.168.56.0/24 by default) as the DHCP server address, lower address bound and upper address bound. If not, your virtual device cannot ANDROID BETTER PRACTICE : ACTIVITY Knowing info of current activity12345678public class BaseActivity extends Activity { private final String TAG = getClass().getSimpleName(); @Override protected void NOTE: STREAMLINING ANDROID APPS: ELIMINATING CODE OVERHEAD Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. This talk will focus on techniques that both libraries and applications can implement to ensure their effect is in generalwithout overhead.
NOTE: CUSTOM VIEWS FOR ANDROID Google I/O 2013 - Writing Custom Views for Android Custom Views and Performance (100 Days of Google Dev) HOW TO CHECK ORIENTATION OF YOUR ANDROID DEVICE IN …TRANSLATE THISPAGE
整理转载自ticktick 在对应的activity中,重载函数onConfigurationChanged1234@Overridepublic voidonConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig);} 在该函数中可以通过两种方法检测当前 ANDROID: HOW TO UPDATE YOUR DB OF APP IN A GOOD WAY 1234567891011121314151617181920212223242526272829303132333435public class MyDatabaseHelper extends SQLiteOpenHelper { //version 1 public static final String CREATE NOTE: STREAMLINING ANDROID APPS: ELIMINATING CODE OVERHEAD Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton. This talk will focus on techniques that both libraries and applications can implement to ensure their effect is in generalwithout overhead.
HOW TO CHECK ORIENTATION OF YOUR ANDROID DEVICE IN …TRANSLATE THISPAGE
整理转载自ticktick 在对应的activity中,重载函数onConfigurationChanged1234@Overridepublic voidonConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig);} 在该函数中可以通过两种方法检测当前 MUYA'S CODEPATHTRANSLATE THIS PAGE Knowing info of current activity. 1 2 3 4 5 6 7 8: public class BaseActivity extends Activity { private final String TAG = getClass().getSimpleName(); @OverrideABOUT SINGLETON
推荐实现方式1234567891011121314public class Singleton { // Private constructor suppresses private Singleton() { } private static class LazyHolder { static fina TAG: JAVA | MUYA'S CODEPATH Java Tag About singleton. 09-01 __ __ MUYA'S CODEPATH __* __
Home
* __
Archives
* __
Tags
NOTE: STREAMLINING ANDROID APPS: ELIMINATING CODE OVERHEAD BY JAKEWHARTON
Posted on 2016-01-24 Streamlining Android Apps: Eliminating Code Overhead by Jake Wharton This talk will focus on techniques that both libraries and applications can implement to ensure their effect is in generalwithout overhead.
It’s a really good stuff to Android developers and those Java developers whether they are doing android or not.CPU
* Do not nest multi-pass layouts * Lazily compute complex data when needed * Cache heavy computational results for re-use * Consider RenderScript for performance * Keep work off the main threadMEMORY
* Use object pools and caches to reduce churn * Be mindful of the overhead of enums * Do not allocate inside the draw path * Use specialized collections instead of JDK collection when appropriate (SparseArray)I/O
* Batch Operation with reasonable back-off policies * Use gzip or binary serialization format * Cache data offline with TTLs for reloading * Use JobScheduler API to batch across OS NOTE: CUSTOM VIEWS FOR ANDROID Posted on 2015-12-25 Google I/O 2013 - Writing Custom Views for Android Custom Views and Performance (100 Days of Google Dev) ANDROID: HOW TO UPDATE YOUR DB OF APP IN A GOOD WAY Posted on 2015-12-081
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class MyDatabaseHelper extends SQLiteOpenHelper {//version 1
public static final String CREATE_BOOK = "create table Book (" + "id integer primary key autoincrement, " + "author text, "+ "price real, "
+ "pages integer, "+ "name text, "
// version 3
+ "category_id integer)"; //version 2, added a table public static final String CREATE_CATEGORY = "create table Category (" + "id integer primary key autoincrement, " + "category_name text, " + "category_code integer)"; public MyDatabaseHelper(Context context, String name,CursorFactory factory, int version) { super(context, name, factory, version);}
@Override
public void onCreate(SQLiteDatabase db) { db.execSQL(CREATE_BOOK); db.execSQL(CREATE_CATEGORY);}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { switch (oldVersion) {case 1:
db.execSQL(CREATE_CATEGORY);case 2:
db.execSQL("alter table Book add column category_id integer");default:
}
}
}
notice there is no key word ‘break’ inside the switch block, therefore, no matter which version that user installed, the db update will be ran properly, and keep the database up to date. HOW TO PREVENT OUR SERVICES OF ANDROID APP FROM BEING KILLED? Posted on 2015-11-16 Sometimes we need our services to do the work but they often were killed by something like a app management tool, here’s some tricksmight help.
SERVICE FLAG
Set to START_STICKY, after around 5 sec of service being killed, it will restart, and pass Intent again.1
2
3
4
5
@Override
public int onStartCommand(Intent intent, int flags, int startId) { flags = START_STICKY; return super.onStartCommand(intent, flags, startId);}
USE STARTFOREGROUND
Use the STARTFOREGROUND(INT, NOTIFICATION) API to put the service in a foreground state, where the system considers it to be something the user is actively aware of and thus not a candidate for killing when low on memory. (It is still theoretically possible for the service to be killed under extreme memory pressure from the current foreground application, but in practice this should not be a concern.)TWIN SERVICE
Create 2 services to protect each other. they will restart the other service when it was killed.EVIL TRICK
Remain 1px size page in the foreground to stay in a foreground state when application goes to background. DISGUISE APP AS SYSTEM APP Install your apk into _/SYSTEM/APP_. Make your app as a system app by changing the proper permissions in arooted device.
WHITE LIST
Contact manufacturer. LISTEN TO THE BROADCAST1
2
3
4
5
6
7
8
BroadcastReceiver,
1
2
3
4
5
6
7
8
9
10
@Override
public void onReceive(Context context, Intent intent) { if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { //start your sercice startUploadService(context);}
if (Intent.ACTION_USER_PRESENT.equals(intent.getAction())) {//...
}
}
You could use INTENT.ACTION_TIME_TICK as better result, this one broadcasts in every minute, however it’s a system broadcast, you can’t config it in _manifest.xml_, register it in your _service_ or _App extends application_,1
2
3
IntentFilter filter = newIntentFilter(Intent.ACTION_TIME_TICK); MyBroadcastReceiver receiver = new MyBroadcastReceiver(); registerReceiver(receiver, filter); In your receiver, let’s say it would look like _MyBroadcastReceiver extends BroadcastReceiver_, override _onReceive()_ method,1
2
3
4
5
6
7
8
9
10
11
12
13
boolean isServiceRunning = false; if (intent.getAction().equals(Intent.ACTION_TIME_TICK)) { ActivityManager manager = (ActivityManager)ThisApp.getContext().getSystemService(Context.ACTIVITY_SERVICE); for (RunningServiceInfo service :manager.getRunningServices(Integer.MAX_VALUE)) { if("so.xxxx.xxxxService".equals(service.service.getClassName())){ isServiceRunning = true;}
}
if (!isServiceRunning) { Intent i = new Intent(context, xxxService.class); context.startService(i);}
}
GENYMOTION WINDOW REMAIN BLACK Posted on 2015-11-15 ------------------------- WHEN I START A VIRTUAL DEVICE, WHY DOES THE WINDOW REMAIN BLACK? ------------------------- The offical Q&A will give you this _You are probably in either of the following situations:_*
_Your network adapter may be misconfigured. In this case:_* _Run VirtualBox._
* _Open File > Preferences > Network (or VirtualBox > Preferencesfor Mac OS X)._
* _Edit the Host-only Network by clicking ._*
_Check that the adapter IPv4 address is in the same network (192.168.56.0/24 by default) as the DHCP server address, lower address bound and upper address bound. If not, your virtual device cannotstart.
You can also remove the Host-only Network by clicking . Genymotion will automatically recreate it at the next virtual device start._*
_Your firewall may block the application. The Genymotion application must connect to the virtual device via the local network. If you have a firewall, make sure that you allowed connections to the Genymotion network, set to 192.168.56.0/24 by default. You can also check the log files to see whether an error occurred. To do so, please refer to How do I generate an archive containing Genymotion logs of a virtual device?. If there is no error, restart your virtual device directly from the VirtualBox application._ ------------------------- Have you met this problem when you use genymotion? I met this problem months ago, when I tried to make it work by following above, I failed. and then I forgot to post my solution online as reference to other who might have the same problem. Here it is. > OS: WINDOWS 8.1 X64 I ran the vm with the VirtualBox and got this error: > init : cannot find ‘/system/bin/install-recovery.sh’ , disabling > ‘flash_recovery’ > IP Management : 192.168.56.101 > failed to execute /sbin/v86d make sure that the v86d helper is > installed and executable Getting VBE info block failed > (eax=0x4f00,err=-2) > vbe_init() failed with -22I have tried
* reinstall both genymotion and VirtualBox * upgrade and downgrade VirtualBoxDid not work.
After submited a ticket to genymotion team, I got a feedback:> _Hello,_
>
> _Running the VM from Virtualbox is not supported. You should use the > “launchpad” that can be started by clicking on the Genymotion> icon._
>
> _Regards,_
>
> _Genymotion Support Team_ Which provides no help. After a lot of google searches, I find a solution, it does not relate to Genymotion directly, UNINSTALL ONE OF THE WINDOWS 8 PATCHES, KB3045999. THIS WILL AFFECT TO EVERY USER WHO IS RUNNING VIRTUAL BOX UNDER WIN8. If you have the same problem under windows as I did, please give it ashot.
COORDINATORLAYOUT NOTE Posted on 2015-10-19 https://www.youtube.com/watch?v=x5o2hGMMmIw 2 ways to attach behavior to the view:Annotation, XML
ANNOUNCEMENT
Posted on 2015-10-19 From now on, I will try my best to build a English blog, after all, I am working in the U.S. You are welcome if this helped you, and if there’s any question or problem, you can find me easily in the github. HOW TO TRACK OPEN STATUS OF AN E-MAIL Posted on 2015-10-12HTML
1
1
PAGE DOES NOT SUPPORT SCRIPT?1
2
3
IMPROVE STABILITY : USING COMBO “SCRIPT + NOSCRIPT” HOW TO CHECK ORIENTATION OF YOUR ANDROID DEVICE IN REAL TIME Posted on 2015-09-14 整理转载自ticktick 在对应的activity中,重载函数onConfigurationChanged1
2
3
4
@Override
public voidonConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig);}
在该函数中可以通过两种方法检测当前的屏幕状态:*
判断newConfig是否等于1
2
Configuration.ORIENTATION_LANDSCAPE, Configuration.ORIENTATION_PORTRAIT 当然,这种方法只能判断屏幕是否为横屏,或者竖屏,不能获取具体的旋转角度.*
调用
1
this.getWindowManager().getDefaultDisplay().getRotation(); 该函数的返回值,有如下四种:1
2
3
4
Surface.ROTATION_0,
Surface.ROTATION_90, Surface.ROTATION_180, Surface.ROTATION_270 其中,Surface.ROTATION_0 表示的是手机竖屏方向向上,后面几个以此为基准依次以顺时针90度递增. BUG: 它只能一次旋转90度, 如果你突然一下子旋转180度, ONCONFIGURATIONCHANGED函数不会被调用. 实时判断屏幕旋转的每一个角度 上面说的各种屏幕旋转角度的判断至多只能判断 0, 90, 180, 270
四个角度,如果希望实时获取每一个角度的变化,则可以通过OrientationEventListener来实现.
*
创建一个类继承OrientationEventListener1
2
3
4
5
6
7
8
9
public class MyOrientationDetector extends OrientationEventListener{ public MyOrientationDetector( Context context ) {super(context );
}
@Override
public void onOrientationChanged(int orientation) { Log.i("MyOrientationDetector ","onOrientationChanged:"+orientation);}
}
*
开启和关闭监听 可以在 activity 中创建MyOrientationDetector 类的对象,注意,监听的开启的关闭,是由该类的父类的 enable() 和 disable() 方法实现的. 因此,可以在activity的 onResume() 中调用MyOrientationDetector 对象的 enable方法, onPause() 中调用MyOrientationDetector 对象的 disable方法来完成功能.*
监测指定的屏幕旋转角度 MyOrientationDetector类的onOrientationChanged 参数orientation是一个从0~359的变量,如果只希望处理四个方向,加一个判断即可:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
if(orientation == OrientationEventListener.ORIENTATION_UNKNOWN) { return; //手机平放时,检测不到有效的角度}
//只检测是否有四个角度的改变 if( orientation > 350 || orientation< 10 ) { //0度orientation = 0;
}
else if( orientation > 80 &&orientation < 100 ) { //90度orientation= 90;
}
else if( orientation > 170 &&orientation < 190 ) { //180度orientation= 180;
}
else if( orientation > 260 &&orientation < 280 ) { //270度orientation= 270;
}
else {
return;
}
Log.i("MyOrientationDetector ","onOrientationChanged:"+orientation);CONTEXT TRICK
Posted on 2015-09-061
2
3
4
5
6
7
8
9
10
public class MyApplication extends Application { private static Context context;@Override
public void onCreate() { context = getApplicationContext();}
public static Context getContext() {return context;
}
}
Changes in AndroidManifest.xml1
2
3
4
5
6
7
8
9
10
11
……
android:name="com.example.networktest.MyApplication" …… >
……
…… >
……
1
2
3
4
5
6
7
8
9
10
11
public static void sendHttpRequest(final String address, final HttpCallbackListener listener) { …… //do something if (!isNetworkAvailable()) { Toast.makeText(MyApplication.getContext() , "network is unavailable" ,Toast.LENGTH_SHORT).show();return;
}
…… //do something}
12 »
Leonard Lin
12 posts
0 categories
3 tags
github
2015 - 2016 __ Leonard LinPowered by Hexo
Theme - NexT.Mist
Details
Copyright © 2024 ArchiveBay.com. All rights reserved. Terms of Use | Privacy Policy | DMCA | 2021 | Feedback | Advertising | RSS 2.0