2 years ago (2017-02-21 00:33:17)

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

11 7
11.8k

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.

Permissions

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 = "http://mgks.infeeds.com";

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: getmgks@gmail.com

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










Sign up or Sign in for free.
And start a new thread.
an14921809202357
I have tried this source but unfortunately it opens any inside link in external browser
mgks
check for permission variables
1 year ago   0 Report Permalink[S]
lolipop
how do I add notifications to the app? For example, a php script to send a notification that you have received a private message?
3 months ago   0 (1 replies) Report Permalink[S]
mgks
it's a pro feature I've included in the paid version.
you can let me know if you want to buy it.
2 months ago   0 Report Permalink[S]
Anshul
With this code current location on webview is not showing when current location variable is true, why ?

Thanks.
mgks
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   0 Report Permalink[S]
R7
ohh, achha udhar se right lena tha.
got it.
Thank you, sir.
2 years ago   -4 Report Permalink[S]
More notes by Ghazi Khan