Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I determine if an Android app is built with a web view?

I am new with Android programming and I am investigation the various approaches to built an app. Right now I am learning native app development using Eclipse and ADT but I also wish to look at webviews and their possibilities. Either done directly using Eclipse/ADT or via tools such as PhoneGap.

I know the pros and cons of webviews, but to better learn under what circumstances they are appropriate and likewise where they fail, I would like to analyze various existing apps and check if they are built upon a webview or programmed natively.

The thing is that I sometimes have a feeling that a given app is a webview because the look and feel is a bit different, but on the other hand perhaps the developers simply chose that look for some reason.

So, can I somehow determine if an app is made from a webview?

like image 805
marlar Avatar asked May 18 '11 19:05

marlar


4 Answers

Try the following option that exist in different phones like S3:

Go to: "setting" -> "Developer options" -> check "show layoutboundaries"

I think that if the app is done native, the boundaries will be displayed for all the objects, while if it is a webview, no boundaries are displayed.

hope that will help...

like image 180
user1386213 Avatar answered Oct 05 '22 08:10

user1386213


Without too much trouble, you can look inside the apk and determine if the app uses WebView:

A. find the apk:

Installed apps are on your Android device in the folder /data/app and has domain-style filenames

/system/app has android apks

B1. If the Android device where the apk is installed is rooted, you can explore the apk on the device using for example the app Solid Explorer.

B2. Alternatively, you can enable debug on your Android device and copy the apk to a computer using adb (apks are actually zip archives.)

C. Then for a WebView app:

C1. Inside the apk, in folder assets, there are typically files with .html extension. These are Web pages displayed in the WebView.

C2. Inside the apk, in file /res/layout/main.xml (or perhaps views by other names with .xml extension), the phrase "WebView" is used.

Many slow apps are in fact not WebViews :)

like image 26
Harald Rudell Avatar answered Oct 05 '22 08:10

Harald Rudell


If you have the source code to the app, look at the source code.

If you do not have the source code for the app, see if it has an About menu or something that indicates what they used, or see if the Web site for the app discloses how they wrote it.

I would venture that 95% or more of Android apps are native. Of the remaining 5%, the vast majority that use WebView do so to simply wrap an existing Web site but have it "be an app" for marketing purposes. While PhoneGap is a very slick tool, IMHO only a small percentage of Android apps on the Market use it or similar WebView-based technologies (e.g., Rhodes). That percentage will likely grow over the next few years, particularly as people use PhoneGap to do cross-platform development, or wrap an HTML5 Web app for offline use.

like image 30
CommonsWare Avatar answered Oct 05 '22 08:10

CommonsWare


This works for me:

  • Install & open the app
  • Uninstall WebView by running adb uninstall com.google.android.webview
  • If the app closes after uninstalling WebView then it's using WebView

I'm assuming that you have an updated version of WebView and not the stock version that comes pre-installed on the device

To check if WebView has been updated run adb shell dumpsys package com.google.android.webview | grep versionName and there should be two different versions, one is the current version and the other is the stock version.

like image 41
Abdul Wadood Avatar answered Oct 05 '22 08:10

Abdul Wadood