how to debug javascript on phonegap/android 2.2 - android

I'm writing a mobile marketing app, which is supposed to work on both iOS and android 2.2. The app is working just fine on iOS, but several things aren't working on android. It seems like some javascript responsible for handling button press events, with jQuery, is the culprit, however, to find the location of the error, I'm looking at the old-school equivalent of printline. Does anyone know of anything more convenient?

Don't dis the console.log, I've definitely found it to be useful with PhoneGap apps.
This page http://debug.phonegap.com/ gives you a rough equivalent of FireBug or Chrome's Developer Tools.
Follow the instructions to add the JS include to your page and run your app. You should then be able to use the console.

Related

How to develop the next best alternative to chrome extension in android

I have built a chrome extension that works fine. I know I can't deploy it to android. So I would have to build an app. The app may or may not have anything to do with chrome; I don't know. This isn't a chrome extension question.
But as to the integration between the app and the on-board browser, I see the android api doesn't have any functionality for browser or web integration? Is that correct?
I'm just making sure because building an app that is essentially it's own proprietary browser, just to get my functionality onto android, is not really something I think a lot of people would download. I'm looking for a more integrated way than that. Is there one?
For those who say impossible, I know for a fact there is an app which added a context menu inside chrome on android but I have no idea how they did that or what other integration is possible. It was a webpage pdf converter. Upon clicking that menu it converted the webpage to pdf, and opened the pdf in the app.

how to debug to find out the reason why the website doesn't get displayed on android browser

I am doing some tests and realised that android browser does not display my website. The other browsers are ok.
I used these libraries:
easeljs
mathjax
jquery
I also used html5 webworkers. This is my test website: thewebdesign.org/v16/
My question is:How to find out the reasons.
Take a look at https://developers.google.com/web/tools/chrome-devtools/debug/remote-debugging/remote-debugging to be able to inspect the chrome console.
Hope it helps.
Remote debugging is the most accurate / best, as suggested above, but if you are not able to use remote debugging: You can try out browserstack (http://browserstack.com/). Even though you would fix the android issue, there are no guarantees, IOS works. That is why I have been using browserstack, to test IOS.

JQuery not working with android browser

I have been using jquery for my web development for a while, and when i use android browser to view my work, i find out that all the jquery function like hide() show() doesn't seems to work.
Can anyone validate this for me, I wonder why jquery is not working for android browser, I am using 2.3.1 right now. Does anyone come across with this problem before?
jQuery works just fine in Android browser. The problem isn't that jQuery doesn't work in Android. The problem is something else.
It's hard to say what that problem might be without any code, but you can try to get more hints as to what might be going wrong by looking in the JS error console (or whatever the equivalent is in Android or an Android emulator--basically, where JS errors are logged).
If you want to get super ambitious, you can try debugging it with Weinre or something like that.
Since you did not post code, we do not know if you were loading your JS assets from the same domain or not. After putting jQuery on the same server instead of using a CDN it resolved my issue. I also had other random JS errors and then I cleared all the data/cache for Chrome and that fully resolved it.
If the issue is something else, you can follow the instructions here to do remote debugging on any of the JavaScript errors:
https://developer.chrome.com/devtools/docs/remote-debugging
Jquery current browser support on desktop and mobile: https://jquery.com/browser-support/
So seems the problem is not with jquery support for native android emulation, since Stock browser on Android 4.0+ is supported by. Any problem with jQuery in the above browsers should be reported as a bug in jQuery.

How to use an PDF viewer in Flex mobile

I am developing a mobile application in Flex in Adobe Flash buillder 4.6 that will run on Android and iOS.
I need a way to view PDF files stored in the application storage directory. Searched in several forums and none of the suggestions worked for me.
In iOS'm using a StageWebView but Android still have not found a working solution.
Can be used ANE or not.
It needs to work offline, so I can not use google docs as a proxy.
Any suggestions?
I solved as was mentioned earlier.
Continued using webview in iOS and a ANE made a call to the Android application registered to open PDF.
Sorry for delay in giving feedback.
Thans for all

Convert Mobile Web into Native Apllication Using WebView/phoneGap

I am gonna develop a mobile application for multiple devices, say iPhone, iPad and Android Devices like Samsung Galaxy, Samsung Tab and Samsung Galaxy Nexus,
The application is about listing set of information from webservice to list in the application, So I decided to go for Mobile Web app using jquery mobile,
I want to publish the app in Appstore and Android Market, So I want to wrap the Mobile web in to a Native app, I thought an idea of implementing it in a UIWebView in iOS and WebView in Android,
Another option I found out is phoneGap,which provide an SDk to wrap an Web app into a Native iOS or Android App.
Can you people suggest me , Is it better to go with WebView in your native application, or is it really required to use phoneGap, Whether apple will approve my Application if I am using Mobile Web app in a UIWebView, Kindly Suggest.
Note: In my application there is no real need of Using any native functionality of iOS like, Camera, Contacts etc, I just wanna have a list with information fetched from the Webservice.
If you don't need any of the native features phonegap/callback gives you, do not use it. It's a bloated project that will probably add a ton of features you don't need, if you only need a wrapped web application.
Just use a regular webview, enable JS, caching etc and load your HTML into it.
Use phonegap. http://phonegap.com/
If u use it you can use the phonegap build service to generate apps for all platforms via it. you will only have to worry about the js, html part of the app, like you said.
Or if you dont want to use the phonegap build, still creating your own apps with phonegap is way easier as you dont have to write ANY native code.
There were some issues in Phonegap before because of which Apple was rejecting Phonegap apps previously. Thats fixed now, so thats no problem. :)

Categories

Resources