I recently did from the "Difficulty Reading with Atom Reader" question. Now, I'm figuring something about maximum compatibility for the blog app I made, from Android Froyo to Jellybean. The problem is that I got notified by errors while checking using StrictMode. I'm running Eclipse IDE via Windows 7 OS.
//-----[ UI Thread Debug Setup ]-----
if(DEVELOPER_MODE)
{
/*
*
* Manage main thread control for Android 3.0 and later. Not work on Android 2.3.3 and below, otherwise, you will get an error
* for changing minimum SDK version at manifest. If you want to publish this project as an Android app (APK) that will run on
* Android 3.0 or later, set DEVELOPER_MODE to "true", otherwise, will not work. (App for Boy Kuripot [Ver. 1])
*
*/
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectAll().penaltyLog().build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects().detectLeakedClosableObjects().penaltyLog().penaltyDeath().build());
}
Here's what happen if I set the minimum SDK version to 7 and you'll see the errors apeared in red line:
And here's what happen if I set the minimum SDK version to 11 via Android Manifest:
Also, when I run it using AsyncTask, it gets either slower, faster, or just lagging.
//TODO _________________________[ Activity Starter Subclass ]_________________________
private class Post_Task extends AsyncTask<String, Integer, String> // --> This class will be revised and to be used for next version. (Compatible now with Android 2.1 and later.)
{
@Override
protected void onPreExecute()
{
super.onPreExecute();
}
@Override
protected String doInBackground(String... params)
{
//-----[ RSS Feed Setup ]-----
xp.Get_Parse_Feed(URL_link, is, lm.headlines, lm.links);
return "All done!";
}
@Override
protected void onProgressUpdate(Integer... values)
{
super.onProgressUpdate(values);
}
@Override
protected void onPostExecute(String result)
{
super.onPostExecute(result);
}
}
When I revert and run this xp.Get_Parse_Feed(URL_link, is, lm.headlines, lm.links);
code at onCreate() as main thread, sometimes the links we're loaded properly in just a snap. The question is which one should I manage and how to make this blog app compatible with Android 2.1 and up?