question

brewin avatar image
brewin asked

Several issues with the SDK

I have several issues with the SDK. I'm kind of surprised by how many problems I've encountered already. 1. I get this JavaScript error after clicking the Amazon Cloud Player ad. Uncaught TypeError: Object [object DOMWindow] has no method 'closeAdChoices' at about:blank:32 2. After the Kindle Store (or Play Store) is launched, it is not possible to return to the app using the back button. The back button just takes the user to the previous page in the store. The activity should be launched with no history. (FLAG_ACTIVITY_NO_HISTORY) 3. I'm getting many DiskRead and DiskWrite violations with StrictMode enabled. Apparently, not everything is being done in the AsyncTask. 4. The SDK should take care of showing the appropriate ad size to fill the screen. Admob calls this "smart_banner". 5. Ad refreshing should be built into the SDK.
mobile ads
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt15@Amazon avatar image
Matt15@Amazon answered
Hey Brewin, We appreciate your feedback and are currently looking into the issues that you've mentioned. Let us know if you have any other feedback. Thanks Matt
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mttmllns avatar image
mttmllns answered
We're also seeing StrictModeDiskWriteViolations and StrictModeDiskReadViolations in our app using the following policy: StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().penaltyDialog().build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build()); We don't get these violations on the Nexus 7 or a JellyBean emulator. See the stack trace output from logcat below. This happens sometime after onResume() for an activity. I tried setting breakpoints in the Android source but it looks like you guys have a different version of certain files. ActivityStack.setVideoHint() being one of the big ones I can't find. I'm guessing we'll have to disable strict mode when running on the Kindle devices as a workaround. Let me know if you have another solution. Thanks much. LOGCAT: 03-11 16:08:40.145: D/StrictMode(7049): StrictMode policy violation; ~duration=37 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=319 violation=2 03-11 16:08:40.145: D/StrictMode(7049): at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1089) 03-11 16:08:40.145: D/StrictMode(7049): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:106) 03-11 16:08:40.145: D/StrictMode(7049): at libcore.io.IoBridge.open(IoBridge.java:390) 03-11 16:08:40.145: D/StrictMode(7049): at java.io.FileOutputStream. (FileOutputStream.java:88) 03-11 16:08:40.145: D/StrictMode(7049): at java.io.FileOutputStream. (FileOutputStream.java:73) 03-11 16:08:40.145: D/StrictMode(7049): at java.io.FileWriter. (FileWriter.java:80) 03-11 16:08:40.145: D/StrictMode(7049): at com.android.server.am.ActivityStack.setVideoHint(ActivityStack.java:906) 03-11 16:08:40.145: D/StrictMode(7049): at com.android.server.am.ActivityStack.completeResumeLocked(ActivityStack.java:1159) 03-11 16:08:40.145: D/StrictMode(7049): at com.android.server.am.ActivityStack.realStartActivityLocked(ActivityStack.java:714) 03-11 16:08:40.145: D/StrictMode(7049): at com.android.server.am.ActivityStack.startSpecificActivityLocked(ActivityStack.java:759) 03-11 16:08:40.145: D/StrictMode(7049): at com.android.server.am.ActivityStack.resumeTopActivityLocked(ActivityStack.java:1699) 03-11 16:08:40.145: D/StrictMode(7049): at com.android.server.am.ActivityStack.completePauseLocked(ActivityStack.java:1119) 03-11 16:08:40.145: D/StrictMode(7049): at com.android.server.am.ActivityStack.activityPaused(ActivityStack.java:1031) 03-11 16:08:40.145: D/StrictMode(7049): at com.android.server.am.ActivityManagerService.activityPaused(ActivityManagerService.java:4300) 03-11 16:08:40.145: D/StrictMode(7049): at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:372) 03-11 16:08:40.145: D/StrictMode(7049): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1679) 03-11 16:08:40.145: D/StrictMode(7049): at android.os.Binder.execTransact(Binder.java:338) 03-11 16:08:40.145: D/StrictMode(7049): at dalvik.system.NativeStart.run(Native Method) 03-11 16:08:40.145: D/StrictMode(7049): # via Binder call with stack: 03-11 16:08:40.145: D/StrictMode(7049): android.os.StrictMode$LogStackTrace 03-11 16:08:40.145: D/StrictMode(7049): at android.os.StrictMode.readAndHandleBinderCallViolations(StrictMode.java:1617) 03-11 16:08:40.145: D/StrictMode(7049): at android.os.Parcel.readExceptionCode(Parcel.java:1309) 03-11 16:08:40.145: D/StrictMode(7049): at android.os.Parcel.readException(Parcel.java:1278) 03-11 16:08:40.145: D/StrictMode(7049): at android.app.ActivityManagerProxy.activityPaused(ActivityManagerNative.java:1935) 03-11 16:08:40.145: D/StrictMode(7049): at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2711) 03-11 16:08:40.145: D/StrictMode(7049): at android.app.ActivityThread.access$800(ActivityThread.java:126) 03-11 16:08:40.145: D/StrictMode(7049): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1174) 03-11 16:08:40.145: D/StrictMode(7049): at android.os.Handler.dispatchMessage(Handler.java:99) 03-11 16:08:40.145: D/StrictMode(7049): at android.os.Looper.loop(Looper.java:137) 03-11 16:08:40.145: D/StrictMode(7049): at android.app.ActivityThread.main(ActivityThread.java:4487) 03-11 16:08:40.145: D/StrictMode(7049): at java.lang.reflect.Method.invokeNative(Native Method) 03-11 16:08:40.145: D/StrictMode(7049): at java.lang.reflect.Method.invoke(Method.java:511) 03-11 16:08:40.145: D/StrictMode(7049): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 03-11 16:08:40.145: D/StrictMode(7049): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 03-11 16:08:40.145: D/StrictMode(7049): at dalvik.system.NativeStart.main(Native Method) 03-11 16:08:41.715: D/StrictMode(7049): StrictMode policy violation; ~duration=35 ms: android.os.StrictMode$StrictModeDiskWriteViolation: policy=319 violation=1 03-11 16:08:41.715: D/StrictMode(7049): at android.os.StrictMode$AndroidBlockGuardPolicy.onWriteToDisk(StrictMode.java:1063) 03-11 16:08:41.715: D/StrictMode(7049): at libcore.io.BlockGuardOs.write(BlockGuardOs.java:190) 03-11 16:08:41.715: D/StrictMode(7049): at libcore.io.IoBridge.write(IoBridge.java:447) 03-11 16:08:41.715: D/StrictMode(7049): at java.io.FileOutputStream.write(FileOutputStream.java:187) 03-11 16:08:41.715: D/StrictMode(7049): at java.io.OutputStreamWriter.flushBytes(OutputStreamWriter.java:167) 03-11 16:08:41.715: D/StrictMode(7049): at java.io.OutputStreamWriter.close(OutputStreamWriter.java:140) 03-11 16:08:41.715: D/StrictMode(7049): at com.android.server.am.ActivityStack.setVideoHint(ActivityStack.java:913) 03-11 16:08:41.715: D/StrictMode(7049): at com.android.server.am.ActivityStack.completeResumeLocked(ActivityStack.java:1159) 03-11 16:08:41.715: D/StrictMode(7049): at com.android.server.am.ActivityStack.realStartActivityLocked(ActivityStack.java:714) 03-11 16:08:41.715: D/StrictMode(7049): at com.android.server.am.ActivityStack.startSpecificActivityLocked(ActivityStack.java:759) 03-11 16:08:41.715: D/StrictMode(7049): at com.android.server.am.ActivityStack.resumeTopActivityLocked(ActivityStack.java:1699) 03-11 16:08:41.715: D/StrictMode(7049): at com.android.server.am.ActivityStack.completePauseLocked(ActivityStack.java:1119) 03-11 16:08:41.715: D/StrictMode(7049): at com.android.server.am.ActivityStack.activityPaused(ActivityStack.java:1031) 03-11 16:08:41.715: D/StrictMode(7049): at com.android.server.am.ActivityManagerService.activityPaused(ActivityManagerService.java:4300) 03-11 16:08:41.715: D/StrictMode(7049): at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:372) 03-11 16:08:41.715: D/StrictMode(7049): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1679) 03-11 16:08:41.715: D/StrictMode(7049): at android.os.Binder.execTransact(Binder.java:338) 03-11 16:08:41.715: D/StrictMode(7049): at dalvik.system.NativeStart.run(Native Method) 03-11 16:08:41.715: D/StrictMode(7049): # via Binder call with stack: 03-11 16:08:41.715: D/StrictMode(7049): android.os.StrictMode$LogStackTrace 03-11 16:08:41.715: D/StrictMode(7049): at android.os.StrictMode.readAndHandleBinderCallViolations(StrictMode.java:1617) 03-11 16:08:41.715: D/StrictMode(7049): at android.os.Parcel.readExceptionCode(Parcel.java:1309) 03-11 16:08:41.715: D/StrictMode(7049): at android.os.Parcel.readException(Parcel.java:1278) 03-11 16:08:41.715: D/StrictMode(7049): at android.app.ActivityManagerProxy.activityPaused(ActivityManagerNative.java:1935) 03-11 16:08:41.715: D/StrictMode(7049): at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2711) 03-11 16:08:41.715: D/StrictMode(7049): at android.app.ActivityThread.access$800(ActivityThread.java:126) 03-11 16:08:41.715: D/StrictMode(7049): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1174) 03-11 16:08:41.715: D/StrictMode(7049): at android.os.Handler.dispatchMessage(Handler.java:99) 03-11 16:08:41.715: D/StrictMode(7049): at android.os.Looper.loop(Looper.java:137) 03-11 16:08:41.715: D/StrictMode(7049): at android.app.ActivityThread.main(ActivityThread.java:4487) 03-11 16:08:41.715: D/StrictMode(7049): at java.lang.reflect.Method.invokeNative(Native Method) 03-11 16:08:41.715: D/StrictMode(7049): at java.lang.reflect.Method.invoke(Method.java:511) 03-11 16:08:41.715: D/StrictMode(7049): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 03-11 16:08:41.715: D/StrictMode(7049): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 03-11 16:08:41.715: D/StrictMode(7049): at dalvik.system.NativeStart.main(Native Method) [b][/b][b][/b][b][/b]
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt15@Amazon avatar image
Matt15@Amazon answered
Hey mttmllns, Thank you for the information. We are currently looking into this. In your case, I would recommend disabling strict mode. Matt
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.