Wednesday, May 19, 2010

Re: [android-developers] Executing a JavaScript from Android application

> I have an Android application that needs to incorporate some
> JavaScript code that tracks user events inside my application and
> submits feedback to an Analytics engine/service.
>
> This code needs to run on first visit of each Activity.
>
> Almost none of these Activities have WebViews.
>
> What would be the best approach to follow to incorporate the JS code?

Port it to Java.

Or, use something that has a public REST-style Web service interface.

Or, use something designed for Android. There are several analytics firms
that support Android -- Flurry, Medialets, etc.

> Should I include an invisible WebView in every page and somehow make
> it execute the JavaScript in onCreate()?

That will slow down the start of your app and will consume a lot of
memory. I doubt your users will appreciate this.

--
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate