Note that there are some explanatory texts on larger screens.

plurals
  1. POCommunication with embedded (UI)Webviews in existing iOS and Android Apps
    primarykey
    data
    text
    <p>This app already exists in the Apple App store and Android markets. It is an app that uses a lot of native code and is not a candidate to be fully html5ed.</p> <p><strong>Longwinded Description</strong></p> <p>I want to have a Web-based series of settings pages. Some of these pages will live locally on the mobile device, and some will be hosted on a remote server. The native app will need to communicate with the local web pages to get and set information in the webpage using javascript. </p> <p>For instance, the first page shown in the WebView/UIWebview will be a local index page. If the remote website is down, the links on the index page to the remote pages will be greyed out. On loading the WebView, the native app will need to detect the reachability of that page and send javascript to the page to grey out the buttons. Likewise, some settings changes made in the local web pages need to be sent back to the Native app for processing.</p> <p><strong>Short and Sweet Requirements Summary</strong></p> <ul> <li>Embed remote and local webpages in a webview</li> <li>Theses webpages will be the same for both Android and iOS</li> <li>Local pages use JavaScript to get data from and send data to the Native Mobile App</li> </ul> <p><strong>Potential Solution Pathways</strong> </p> <p>A. <em>PhoneGap</em></p> <p>I realize that Phonegap would work well for this if my application was entirely a web app. From my reading it seems like Phonegap doesn't really like to be embedded in a native app for part time work. </p> <p>What? You say it's really easy and I've been grossly misinformed? Enlighten me oh wise one.</p> <p>B. <em>Roll My Own</em></p> <p>I'm open to rolling my own solution, however the methods for getting and setting information via Javascript from the Webviews to the Native Apps seems quite disparate. More-so the getting than the setting (bogus URLs for iOS, very nice AddJavaScriptInterface for Android). Also, it seems like this path could lead to a severe maintenance headache in the future. </p> <p>Say what? Your genius programmer friend has made a website describing this process in excruciating detail? Tell me more.</p> <p>C. <em>3rd Party Library</em></p> <p>The perfect 3rd party library that does everything I want (and more!) exists? Save me from my ignorance.</p> <hr /> <p><strong>Decision</strong></p> <p>In the future, it seems like PhoneGap's 'Cleaver' project will be the best way to do this. </p> <p>Since it's not ready for Android yet, it seems that the current (Early June '12) best solution for write-once-embedded-HTML is to use a fake URL scheme to communicate from the web page to the native app (both platforms can execute JS on the page directly when going from native app to web page).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload