WebViewGold for Android

Provider: OnlineAppCreator.com
(distributed via CodeCanyon.net)

Get the source code: Download
FAQs: Click here
Support: Click here

WeSetupYourWebViewApp.com


Get WebViewGold for iOS
Get WebViewGold for macOS
Get photos2webgallery for macOS




Intro

WebViewGold for Android is a great choice. Thanks for downloading!


Stay tuned

Please do not forget to rate this project on CodeCanyon. It only takes a few seconds.
Just navigate to the Downloads section of CodeCanyon:

Rate the project on CodeCanyon and motivate us for a lot of updates ;-)
We are looking forward to receiving your feedback :)


Let's become friends with each other!

Follow us for updates, coupons and more:
  • Instagram
  • Facebook
  • Twitter
  • YouTube
  • LinkedIn

  • If you have any questions, please feel free to ask!

     


    Changelog

    see the changelog here.


    1) Setup your web app/website/HTML files

    Option 1: Use a URL for accessing your web application (= store files online):

    Create a mobile-optimized website, for example, using jQuery Mobile and upload your site to your webserver/webspace. WebViewGold supports all kinds of web apps/websites (including HTML, PHP, WordPress, Progressive Web Apps, HTML 5 Games, WiX, bubble.is, …). Please make sure to optimize your website to feel like an app. For example, may disallow user zooming:

    <meta name="viewport" content="width=device-width, user-scalable=no" />


    Option 2: Use a local HTML folder for accessing your web application (= store files within the app):

    WebViewGold supports web apps bases on local HTML folders too: Copy your HTML/CSS/JavaScript files to the Android Studio project and set USE_LOCAL_HTML_FOLDER to true (see next step).


    2) Setup the Android Studio project


    Download the WebViewGold app template here.

    Afterward, open Android Studio:

    Android Studio welcome screen

    Choose Import project:

    Import Project button

    Select your AndroidStudioSource folder and wait until the project loaded completely:

    Android Studio file picker

    Afterward, open Config.java file to edit main configuration details (URL, URL Handling, UserAgent, dialogs). Please take a look on our YouTube channel for specific setup tutorials. Please don't forget to add your envato/CodeCanyon Purchase Code in the PURCHASECODE field for each app published by you. One license per each customized end product is required. Please take a look for license info of your CodeCanyon purchase: https://codecanyon.net/licenses/standard
    The main configuration document Config.java looks like this:

    Config.java allows you to configure most of the settings directly in the document

    Setting up apps with WebViewGold is very easy and does not require any coding knowledge. Please take a look at this overview of the built-in configuration options in Config.java file:

    HOST
    required value
    Your domain host without https:// or http:// prefix (e.g. "www.example.org")
    HOME_URL
    required value
    Your full WebView URL (e.g. "https://www.example.org/app.html") which should be loaded in the WebView
    USE_LOCAL_HTML_FOLDER
    true or false
    Set to true to use local "index.html" HTML file instead of remote WebView URL
    ACTIVATE_PROGRESS_BAR
    true or false
    Set to false to disable the progress spinner/loading spinner
    USER_AGENT
    optional
    Define a customized UserAgent for web requests (or leave it empty to use the default Android UserAgent)
    OPEN_EXTERNAL_URLS_IN_ANOTHER_BROWSER
    true or false
    Set to true to open all external hosts in an external browser (outside your app)
    CLEAR_CACHE_ON_STARTUP
    true or false
    Set to true to clear the WebView cache on each app startup and do not use cached versions of your web app/website
    IS_DEEP_LINKING_ENABLED
    true or false
    Set to true to enable deep-linking
    SPLASH_SCREEN_ACTIVATED
    true or false
    Set to true to activate the splash screen
    SPLASH_TIMEOUT
    number value (seconds)
    Set the splash screen timeout in milliseconds
    SHOW_FIRSTRUN_DIALOG
    true or false
    Set to false to disable the First Run Dialog
    SHOW_FACEBOOK_DIALOG
    true or false
    Set to false to disable the Follow On Facebook Dialog
    SHOW_RATE_DIALOG
    true or false
    Set to false to disable the Rate This App Dialog
    RATE_DAYS_UNTIL_PROMPT
    number value (days)
    Set the minimum number of days to be passed after the application is installed before the "Rate this app" dialog is displayed
    RATE_LAUNCHES_UNTIL_PROMPT
    number value (launches)
    Set the minimum number of application launches before the "Rate this app" dialog will be displayed
    FACEBOOK_DAYS_UNTIL_PROMPT
    number value (days)
    Set the minimum number of days to be passed after the application is installed before the "Follow on Facebook" dialog is displayed
    FACEBOOK_LAUNCHES_UNTIL_PROMPT
    number value (launches)
    Set the minimum number of application launches before the "Rate this app" dialog is displayed
    FACEBOOK_URL
    value (URL)
    Set the URL of your Facebook site
    PUSH_ENABLED
    true or false
    Set to true to activate OneSignal Push (set OneSignal IDs in the build.gradle file)
    PUSH_ENHANCE_WEBVIEW_URL
    true or false
    Set to true if you want to extend URL request by ?onesignal_push_id=XYZ (set the OneSignal IDs in the build.gradle file)
    PUSH_RELOAD_ON_USERID
    true or false
    Set to true if WebView should be reloaded when the app gets a UserID from OneSignal (set the OneSignal IDs in the build.gradle file)
    SHOW_BANNER_AD
    true or false
    Set to true if you want to display AdMob banner ads (set the AdMob IDs in the strings.xml file)
    SHOW_FULL_SCREEN_AD
    true or false
    Set to true if you want to display AdMob fullscreen interstitial ads after X website clicks (set the AdMob IDs in the strings.xml file)
    SHOW_AD_AFTER_X
    value (website reloads)
    Set the number X of website clicks for AdMob interstitial ads (set the AdMob IDs in the strings.xml file)
    PURCHASE_LICENSE_KEY
    value (API Key)
    Set the Google Play In-App Purchase Key (receive it from Google Play Developer Console)
    PURCHASE_ITEM
    value (Name)
    Set the Purchase Item Name ID (same as in Play Store Developer Console)
    HIDE_ADS_FOR_PURCHASE
    true or false
    Set to true to hide AdMob ads after successful In-App Purchase


    Open strings.xml file to edit app name & text strings:

    string.xml file for editing text captions

    Open dimens.xml file to modify text formatting:

    Use dimens.xml to resize objects and text


    Open colors.xml file to edit colors of status bar and loading sign/loading indicator.


    3) Change the App Icon

    Android App Icon
    A beautiful app icon is a perfect first impression for your customers. It's easy to add your app icon to your WebViewGold project: Make a right-click on each ic_launcher.png size (from hdpi to xxxhdpi) and click "Reveal in Finder" (Mac) or "Reveal in Explorer" (Windows). Replace the file with your icon. Alternatively, use this helpful tool: Launcher Icon Generator (we are not affiliated with the developer company).


    4) Change Splash Screen



    Just replace the included splash.png files with your own resized image files:

    Splash Screen Configuration

    You can change the timeout in Config.java file:

    Maximum time of Splash Screen


    It often makes sense in WebView based apps to treat different web addresses differently. If you place a social media button in your web app, a click on it should probably not open the social media page in your app, but in the right app (e.g., the system browser). It's good that WebViewGold has all the features to enable powerful configuration and treat links the way you want it.

    Option 1: Open all external hosts in System Browser

    If you want to open every URL, which is not on your host in System Browser, please set OPEN_EXTERNAL_URLS_IN_ANOTHER_BROWSER (in Config.java file) to true.

    Option 2: Open only specific hosts in System Browser

    Please add this snippet for each domain/host:
    
    if (urlString.startsWith("https://example.org") {
    try {
    final URL url = new URL(urlString);
    if (!url.getHost().equalsIgnoreCase(Config.HOST)) {
    final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlString));
    final int newDocumentFlag = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) ? Intent.FLAG_ACTIVITY_NEW_DOCUMENT : Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET;
    intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | newDocumentFlag | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
    startActivity(intent);
    return true;
    }
    } catch (MalformedURLException e){
    e.printStackTrace();
    }
    }
    
    Please place it into the public boolean shouldOverrideUrlLoading(WebView view, String urlString) { section in MainActivity.java file.

    To add another domain, just copy this part and insert another host, which should be opened in System Browser. Please enter the host precisely the way you link to it.


    URL Handling – Open links in tab/additional In-App-Browser

    There are some cases for links that do not feel to be "important enough" to open them in the System browser externally but "too specific" for opening them in the app WebView itself (e.g., your Terms and Conditions page). For this particular kind of links, we added a creative idea of URL Handling: a tab that opens an additional in-app-browser over the main WebView content itself. It will look like this:

    Open a link in an additional in-app-browser/tab in Android WebView apps

    As you see this in-app-browser includes an address bar and navigation buttons. That's a considerable difference to the primary, full-screen WebView content. So this kind of combination of app and browser experience is great for tutorials, knowledge databases, and all type of content that requires any type of navigation. To use this kind of in-app-browser, link to an URL in this format:

    <a href='#' onClick="top.location.href='https://www.google.com';">Open Google</a>
    
    


    Please insert https://www.webviewgold.com/demo/testlinks.php as WebView URL to test how your app will handle different types of links. You can open the same domain https://www.webviewgold.com/demo/testlinks.php in your desktop browser and see the source code to copy & paste the way of link.


    Custom CSS

    The Custom CSS feature of WebViewGold allows you to customize the appearance of your web application without the need to customize the CSS style sheets of your web application itself. The custom CSS classes will be applied to all website loads requested by your application built with WebViewGold. Just insert the custom CSS in the file file custom.css and save the changes:

    Custom CSS


    HTML5 Geolocation

    The HTML5 Geolocation feature enables users to communicate their own position to a web application. Check out the Mozilla guide on how to implement geolocation into your website or web app. In WebViewGold, the HTML5 Geolocation API will work by default after you integrated it into your web content. Demo: https://www.w3schools.com/html/html5_geolocation.asp
    If your app does not need geolocation, you can delete askForPermission(); line in MainActivity.java file in order to not ask your user for that kind of permission.


    Push Notifications via OneSignal & JavaScript API

    Push notifications are notifications that appear on your smartphone without opening the app. These types of messages allow fantastic interaction with customers and users of the app. Your app does not have to be open. This way, your customers do not miss any important news or messages. Push Notifications are suitable for many cases, e.g., for updates to orders, live tickers, or social media community. There must be an internet connection to allow app users to receive push messages. WebViewGold supports multiple ways of reaching your users via push notifications.

    Option 1: Use Local Push Notification JavaScript API

    You can insert a piece of code (JavaScript) in your website, to define a push notification, which can be shown after your app was closed (while scheduling it during the app is open). This works without OneSignal configuration at all.

    <script>
    var seconds = 120; //seconds from now on
    var message = "It is Happy Hour now! Check it out!"; //the message
    var button = "Open App"; //the text of the button
    window.location.href = "sendlocalpushmsg://push.send?s="+ seconds +"=msg!"+ message +"&!#"+ button +"";
    </script>
    

    It could be used for different situations (countdowns, happy hours (like in the example code), reminders, ...).
    To cancel all scheduled local push notifcations run:
        <script>
        window.location.href = "sendlocalpushmsg://push.send.cancel";
        </script>
    

    Option 2: Use OneSignal Remote Push Notifications

    If you want to use OneSignal in your app, activate these options in Config.java (by switching the values from false to true):
    Configuration of OneSignal

    Please set your OneSignal App ID in build.gradle file afterward:


    Enter your application identifier of OneSignal to enable push notifications


    Setup the OneSignal service for your Android app. Yay, you are done. You can send push notifications now:

    How to send a push message in OneSignal

    If you want to use OneSignal URL Deeplinking (opens a specific URL when clicking on your notification), please add the desired URL with a custom field called url:

    Add a custom URL for deeplinking purposes in WebView


    Do you want to get each individual user ID on your server for further processing and individual user push messages? Just activate the „PUSH_ENHANCDE_WEBVIEW_URL" option in Confing.java (by switching the value from false to true) in order to append ?onesignal_push_id=XYZ to your WebView URL. If your WebView URL is https://www.example.org, WebViewGold will call https://www.example.org?onesignal_push_id=XYZ instead. Only your FIRST URL request will get that GET variable, so save it in a session or in a cookie to access it on your linked pages.




    Banner and Interstitial ads via AdMob

    AdMob offers the possibility of monetizing mobile projects. It is a Google-provided service for integrating Google ads into mobile applications. The AdMob program allows mobile application developers to incorporate ads on iOS and Android platforms. The ad space provided by the app developer is paid by clicks (CPC, Cost Per Click) or impressions (CPM, Cost Per Mille). WebViewGold is ready for activating AdMob ads by default, and it allows you to monetize your WebView-based applications. Make sure to buy an extended license of WebViewGold if you want to make money with apps based on WebViewGold.

    Open Config.java file:

    Monetize your WebView apps with native AdMob SDK

    You can activate and deactivate banner and/or interstitial ads and define the interval of appearing interstitial ads. Please set your AdMob IDs in the strings.xml file before launching your app:

    Enable specific AdMob ad blocs in your app

    For more information, please consider the official AdMob SDK documentation as well (but skip the setup parts as WebViewGold already includes the framework).


    Image, PDF and Music file downloader API

    If you offer to download or view documents or other downloads in your web app, our WebViewGold Download API will help you for the tremendous and native user experience of your app.

    Save images to the camera roll of the user by calling links with savethisimage://?url= prefix:
    <a href="savethisimage://?url=IMAGE URL HERE">Link</a>
    

    Save PDF files by calling links with .pdf suffix:

    <a href="https://www.example.org/file.pdf">Link</a>
    

    Save Music files by calling links with .mp3, .mp4 or .wav suffix:

    <a href="https://www.example.org/file.mp3">Link mp3</a>
    <a href="https://www.example.org/file.mp4">Link mp4</a>
    <a href="https://www.example.org/file.wav">Link wav</a>
    

    Sometimes only a restart helps. This is true in life as well as in digital life. Click on this link to reset your users' app to app factory settings (by clearing all cookies and cache):

       <a href="reset://">Link</a>
    

    Insert the https://www.onlineappcreator.com/reset_test.html URL into your WebViewGold app for a demo.



    WebViewGold allows configuring a link scheme like www.webviewgold.com/link= which can be triggered from Mail app, browser apps, ... and opens the attached link in the WebView app. Please change the scheme to your own app name (like www.example.org/link= instead of www.webviewgold.com/link=) in AndroidManifest.xml:

    AndroidManifest.xml for App Link Configuration

    Afterward, activate the IS_DEEP_LINKING_ENABLED option in Config.java file:

    Config.java for App Link Configuration

    Done! :) Example format: http://www.webviewgold.com/link=https://www.google.com (this link would open www.google.com in WebView app).


    App Sharing Dialog

    The Sharing Dialog functionality of WebViewGold gives your app users the ability to share the download link of your application with their friends, family, and colleagues. It's an incredibly smooth and effective way of expanding the user base of your application.



    WebViewGold allows triggering a native App Sharing Dialog dialog (WhatsApp, SMS, Mail, ...) by calling shareapp:// links:
    <a href="shareapp://">Share app</a>
    Clicking on such a link will trigger the sharing dialog which shares your Google Play Store download link:

    Sharing Dialog


    In-App Purchases



    Within some apps, you can buy additional content or services. These kinds of purchases are called "in-app purchases". They can be an attractive source of revenue for developers and are very convenient for customers as they use existing accounts and payment sources for settlement. WebViewGold allows triggering Google Play In-App Purchases. Make sure to own an extended license of WebViewGold if you plan to use this feature in an end product. Afterward, insert the license key of your In-App Purchase Product in Config.java file:

    Google Play In-App Purchase Product ID in Config.java file

    Afterward, just link to this kind of URL:
    <a href="inapppurchase://?successful_url=https://www.google.de">Buy In-App Purchase</a>


    Rename package name / build & publish your app

    Do you want to publish your app in the Google Play Store?
    Sure, but please change the package name to any unique package name before.
    Do a full backup of your source code folder before.



    Just uncheck the „Compact Empty Middle Packages“ option, click on the first name part, Refactor > Rename and select "Rename current" when asked. You have to change the new package name everywhere in AndroidManifest.xml and build.gradle file as well.
    Make sure to export a signed APK file afterward: https://developer.android.com/studio/publish/app-signing

    Make sure that the content does not contradict the legal requirements of the Google Play Store. Use different link colors than standard HTML colors for better user experience.

    If Google rejects your app, we offer you a full refund of the WebViewGold license (by claiming within 14 days after purchase). Just contact us by mail.

    Congrats to your own published app! :)



    Credits / License / Upgrade to Extended License

    Please don't forget to add your envato/CodeCanyon Purchase Code in the PURCHASECODE field for each app published by you. One license per each customized end product is required.

    You will need an envato/CodeCanyon extended license if any of these cases apply:


    If you already bought a regular license, you can upgrade the existing license here.

    All rights (e.g. of images) belong to their respective owners. The provider of this source code is OnlineAppCreator.com c/o jocapps GmbH - registered in Germany - and is not affiliated with Google.

    Please take a look for license info of your CodeCanyon purchase: https://codecanyon.net/licenses/standard



    Rate this project

    If you have 10 seconds, please rate this project (it's a great motivation for future updates ^^):

    1. Go to CodeCanyon.net and sign in
    2. Navigate to https://www.codecanyon.net/downloads
    3. Click the stars, as shown in this picture:

    Feedback helps us a lot!

    Thank you very much!



    Get WebViewGold for iOS

    Get WebViewGold for iOS

    Take a look here.


    Get WebViewGold for macOS

    Get WebViewGold for macOS

    Take a look here.


    Get photos2webgallery for macOS

    Get photos2webgallery for macOS

    Take a look here.


    Support


    OnlineAppCreator
    Designed and coded with lots of love and coffee in Germany. Made for everyone and made with 100% renewable energy. #MakeLoveNotWar

    © 2019 OnlineAppCreator.com [Privacy Policy | Legal Disclosure]
    exclusive distribution by CodeCanyon.net