Debug on Android devices

Dear all,

this is simple (but I didn’t find any answers on the forums): how do I debug my app on an Android device?

On the simulator my app works, but on the device, when I open a native.showWebPopup, I see some weird images for a split second, and then the popup disappears.

Cheers! [import]uid: 94362 topic_id: 23241 reply_id: 323241[/import]

One additional piece of information: this seems like a bug.

If I remove the html anchor from the URL, so given a “a name=text” in the html, I don’t ask for “index.html#text”, but simply “index.html”, the web popup is correctly shown.

However, it seems that the weird images are related to an incorrect disposal of the popup. I don’t know how to remove them, I just wrote a simple listener:

 local function listener( event )  
 local shouldLoad = true  
   
 local url = event.url  
 --print("url = " .. url)  
  
 -- Close the view  
 if 1 == string.find(url, "corona:close") then  
 -- Close the web popup  
 --native.cancelWebPopup()  
 shouldLoad = false  
 director:changeScene(contents.targetScene, "crossFade")  
 end  
   
 -- Error handler  
 if event.errorCode then  
 -- Error loading page  
 --print( "Error: " .. tostring(event.errorMessage))  
 shouldLoad = false  
 end  
  
 return shouldLoad  
 end  

I tried to use native.cancelWebPopup(), but the simulator dies. Am I doing something I should avoid? [import]uid: 94362 topic_id: 23241 reply_id: 93037[/import]

I don’t know much about Android but I can point you in a direction for debug. There’s a program that ships with Android SDK called DDMS. In there you can see the debug of any device you got connected by wire.

You’ll probably get some useful information there. [import]uid: 61899 topic_id: 23241 reply_id: 93055[/import]

If you dont want to debug by wire, you can always load the app call ‘logcat’.

It will display all messages that go to the system console.

You will see ‘everything’ - including all the chatter from the system processes.

Add a filter for “corona” - and then you should see only the messages from your app.

Good luck! [import]uid: 9070 topic_id: 23241 reply_id: 93061[/import]