Android Smart WebView open source to upload files, get GPS locations and more advanced features

12 11 13.2k reads

This project will help you develop Android Advanced WebView App with features out of the box and help you use amazing features the fullest with your existing web apps or simple HTML pages.

I keep updating this project, here are some of its currently available features:

  • Splash screen to give a professional feel to your app.
  • Upload files from Gallery or Camera to your webview using openFileChooser() and onShowFileChooser() methods.
  • Tracking Device's current location using GPS realtime lattitudes and longitudes and sending data to your webpage.
  • App rate dialogue for users with auto configured features based on users choices and usage.
  • Calling custom offline pages on network failures.
  • Opening app on intent actions (as if someone try opening your web URL in browser, your app intent will be called to handle the requested URL)
  • Showing custom notifications. 
  • And more.

Here is a simple walkthrough to help you understand the project:

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. The project requires minimum Android API 16+ (4.1 JellyBean) SDK to test. And you can use any development software of your choice, I used Android Studio making this.


You can remove any of the following requests if you do not need them or you can disable any feature using easy setup variables.

INTERNET permission is required if you are requesting a weburl or webpage and WRITE_EXTERNAL_STORAGE is required for camera photo creation, if you have enabled ASWP_FUPLOAD and ASWP_CAMUPLOAD to upload image files.

Once your project is ready here are some static variables you can change as per your Apps requirement.

ASWP_JSCRIPT = true; // enable JavaScript for webview
ASWP_FUPLOAD = true; // upload file from webview
ASWP_CAMUPLOAD = true; // enable upload from camera for photos
ASWP_LOCATION = true; // track device locations with GPS
ASWP_RATINGS = true; // ask user for app ratings; edit method get_rating() for dialogue customizations
ASWP_PBAR = true; // show page load progress (progess bar) in app
ASWP_ZOOM = false; // ability to zoom view content
ASWP_SFORM = false; // save form cache and auto-fill information

Complete URL of your website, landing page or local file as (file:///android_res/dir/file)

ASWV_URL = "";

If file upload enabled, you can define its extention type, default is "*/*" for all file types; Use "image/*" for image types; check file type references on web for more

ASWV_F_TYPE = "*/*";

Getting GPS Location

If ASWP_LOCATION = true then the app will start requesting GPS locations of the device on regular basis and all of the recorded data will be sent to the webpage in terms of cookies, updating along with locations.

COOKIE "lat" for latitude
COOKIE "long" for longitude

See complete project on GitHub

If you found any bug or want to contribute to the project please contact me at:

Thanks!! Don't forget to share it with your friends, you can share your responses in comments.


Ghazi Khan /u/mgks

verified publisher79 feeds
I have tried this source but unfortunately it opens any inside link in external browser
check for permission variables
2 years ago   Upvote 0 Down Report Permalink[S]
how do I add notifications to the app? For example, a php script to send a notification that you have received a private message?
it's a pro feature I've included in the paid version.
you can let me know if you want to buy it.
4 months ago   Upvote 0 Down Report Permalink[S]
With this code current location on webview is not showing when current location variable is true, why ?

sorry for responding this late, can you make it clear what you mean by not showing? Is it the cookies that's not storing or what method you are using to retrieve that? Just a little more explanation.
1 year ago   Upvote 0 Down Report Permalink[S]
i try this source it feels good just when i switch to https just show blank page, which setting i need to set-up to fix it.
2 months ago   Upvote 0 Down Report Permalink[S]
well written.
4 weeks ago   Upvote 0 Down Report Permalink[S]
Users of android devices can easily get information about source and their policies with read of this newly uploaded document. Students write their assigned projects with essayontime reviews that are very helpful for perfect progresses.
don't advertise here please.
6 days ago   Upvote 0 Down Report Permalink[S]
ohh, achha udhar se right lena tha.
got it.
Thank you, sir.
2 years ago   Upvote -4 Down Report Permalink[S]
more feeds from /u/mgks