[android-developers] Application Startup Time.

2010-10-25 Thread Suneel Dasari
Hi, I am working on a project which uses application start up time for
refreshing the cache.

if (cached_time_stamp  app_start_up_time) then
   use the network to get the data other wise use the data
from the cache.

But not sure how exactly we can handle this situation if the
application is paused. Handling it in onPause or onResume methods.

Any pointers would be of great help.

Thanks in advance,
Suneel

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Error while parsing the JSON response.

2010-07-09 Thread Suneel Dasari
Hi I am getting the below error while parsing JSON.

MY CODE:

Overridden method in POJO RootCategories;

public String toString(){
return Category ID:  + catId
 + Category Name:  + catName
 + Description:  + description
 + isPP:  + isPP
 + isRootCategory:  + isRootCategory
 + isTerminalCategory:  + isTerminalCategory;
}

Parser in my Activity:

private ListRootCategories parse(String jsonString) throws Exception
{

java.lang.reflect.Type collectionType = new
TypeTokenListRootCategories() {
}.getType();
ListRootCategories rootCategories = new
Gson().fromJson(jsonString,
collectionType);
return rootCategories;
}

Please help

Thanks
Suneel


07-08 19:21:00.016: WARN/ActivityManager(69): Launch timeout has
expired, giving up wake lock!
07-08 19:21:00.367: WARN/ActivityManager(69): Activity idle timeout
for HistoryRecord{43f8ed70 com.jcp.androidpoc/.CategoryHomeActivity}
07-08 19:21:09.537: DEBUG/dalvikvm(1072):   JDWP invocation returning
with exceptObj=0x43e270c0 (Ljava/lang/NullPointerException;)
07-08 19:21:15.967: DEBUG/dalvikvm(1072): GC_FOR_MALLOC freed 2799
objects / 181800 bytes in 127ms
07-08 19:21:16.228: WARN/System.err(1072):
java.lang.NullPointerException
07-08 19:21:16.247: WARN/System.err(1072): at
org.apache.harmony.luni.lang.reflect.ListOfTypes.length(ListOfTypes.java:
47)
07-08 19:21:16.268: WARN/System.err(1072): at
org.apache.harmony.luni.lang.reflect.ImplForType.toString(ImplForType.java:
83)
07-08 19:21:16.286: WARN/System.err(1072): at
java.lang.StringBuilder.append(StringBuilder.java:203)
07-08 19:21:16.306: WARN/System.err(1072): at
com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:
56)
07-08 19:21:16.327: WARN/System.err(1072): at
com.google.gson.JsonDeserializationVisitor.visitUsingCustomHandler(JsonDeserializationVisitor.java:
65)
07-08 19:21:16.327: WARN/System.err(1072): at
com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:96)
07-08 19:21:16.356: WARN/System.err(1072): at
com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:
73)
07-08 19:21:16.398: WARN/System.err(1072): at
com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:
49)
07-08 19:21:16.427: WARN/System.err(1072): at
com.google.gson.Gson.fromJson(Gson.java:379)
07-08 19:21:16.457: WARN/System.err(1072): at
com.google.gson.Gson.fromJson(Gson.java:329)
07-08 19:21:16.487: WARN/System.err(1072): at
com.jcp.androidpoc.CategoryHomeActivity.parse(CategoryHomeActivity.java:
137)
07-08 19:21:16.507: WARN/System.err(1072): at
com.jcp.androidpoc.CategoryHomeActivity.onCreate(CategoryHomeActivity.java:
76)
07-08 19:21:16.547: WARN/System.err(1072): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
07-08 19:21:16.597: WARN/System.err(1072): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2627)
07-08 19:21:16.607: WARN/System.err(1072): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2679)
07-08 19:21:16.648: WARN/System.err(1072): at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-08 19:21:16.677: WARN/System.err(1072): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-08 19:21:16.717: WARN/System.err(1072): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-08 19:21:16.756: WARN/System.err(1072): at
android.os.Looper.loop(Looper.java:123)
07-08 19:21:16.807: WARN/System.err(1072): at
android.app.ActivityThread.main(ActivityThread.java:4627)
07-08 19:21:16.818: WARN/System.err(1072): at
java.lang.reflect.Method.invokeNative(Native Method)
07-08 19:21:16.846: WARN/System.err(1072): at
java.lang.reflect.Method.invoke(Method.java:521)
07-08 19:21:16.867: WARN/System.err(1072): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-08 19:21:16.887: WARN/System.err(1072): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-08 19:21:16.887: WARN/System.err(1072): at
dalvik.system.NativeStart.main(Native Method)

07-08 19:21:00.016: WARN/ActivityManager(69): Launch timeout has
expired, giving up wake lock!
07-08 19:21:00.367: WARN/ActivityManager(69): Activity idle timeout
for HistoryRecord{43f8ed70 com.jcp.androidpoc/.CategoryHomeActivity}
07-08 19:21:09.537: DEBUG/dalvikvm(1072):   JDWP invocation returning
with exceptObj=0x43e270c0 (Ljava/lang/NullPointerException;)
07-08 19:21:15.967: DEBUG/dalvikvm(1072): GC_FOR_MALLOC freed 2799
objects / 181800 bytes in 127ms
07-08 19:21:16.228: WARN/System.err(1072):
java.lang.NullPointerException
07-08 19:21:16.247: 

[android-developers] ANDROID: How to load the images from a URL in the Grid.

2010-07-09 Thread Suneel Dasari
Hi
  I have been working on a POC, where I have an activity which
displays a group of images from my local drawable folder in a Grid
view. I have created the ImageAdapter and that has actually an integer
array with the image ids and it is working fine.

But the actual problem is I have to read the image which resides in a
remote server through a URL and display it in the Grid.

Please help

Thanks
Suneel

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en