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




Intro




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:


We are looking forward receiving your feedback :)




Follow us on Facebook & Twitter for updates, coupons & more:
  • Instagram
  • Facebook
  • Twitter

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

     


    1) Setup your website/webapp

    Create a mobile-optimized website, for example using jQuery Mobile and upload your site to your webspace, for example using a webspace package from 1&1. 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" />


    2) Setup Android Studio project

    Open Android Studio:



    Choose Open an existing Android Studio project:



    Open Config.java file to edit main configuration details (URL, URL Handling, UserAgent, dialogs, ...):



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



    Open dimens.xml file to edit text formatting:



    Change the package name if you plan to publish your app in Google Play Store:


    Watch on YouTube

    If your app does not need geolocation, you can delete askForPermission(); line in MainActivity.java file.


    3) Change icon


    Just replace the included image files with your own resized image files. Or just use this nice tool: Launcher Icon Generator (we are not affiliated with the developer company).


    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 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") {
        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;
        }
    
    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 exactly the way you link to it.


    Push Notifications via OneSignal & JavaScript API

    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 Confing.java (by switching the values from false to true):


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





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

    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:


    You want to get each unique OneSignal user ID on your server for further processing and personalized 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.




    Banner and Interstitial ads via AdMob

    Open Config.java file:



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




    Images and PDF Downloader

    Save images to the camera roll of the user by running this script on your website:

        <script>
        var imgurl = "https://www.example.org/example.png"; //Image URL
        window.location.href = "savethisimage://?url="+ imgurl +"";
        <script>
    

    Save PDF files by calling links with .pdf suffix:

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

    WebViewGold allows to configure 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:



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



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


    Credits / License

    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, like shown in this picture:



    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.


    Support & Custom Code Service


    Click here


    WeSetupYourWebViewApp.com




    © 2018 OnlineAppCreator.com [Privacy policy | Imprint]
    exclusive distribution by CodeCanyon.net