Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to wrap a website in a phone app?

I have seen a lot of mobile phone apps that just open a web page without the controls. Just the page.

I am looking for guidance and links to start something simple like this.

like image 232
EnexoOnoma Avatar asked Nov 12 '11 01:11

EnexoOnoma


People also ask

What is a web wrapper app?

With website wrapping, your site is transitioned into a mobile application framework that is compatible with iOS and Android devices. It can be added to the app stores and easily downloaded via a link. When using an app wrapper, your website content is basically the same. It's the background architecture that changes.

Can you make a website an app on your phone?

Turn a Website Into a Lite App for Android You'll almost certainly get what you want there. If you don't find it, just type in the URL of a site and Hermit will turn it into a standalone app on your home screen.


2 Answers

If you would like to wrap a website in Android you may do so with this code, from Roskvist

package com.webview; import android.app.Activity; import android.os.Bundle; import android.view.Window; import android.webkit.WebView;  public class WebViewTest extends Activity {      WebView browserView;     /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);          //Removes the title bar in the application         requestWindowFeature(Window.FEATURE_NO_TITLE);         setContentView(R.layout.main);          //Creation of the Webview found in the XML Layout file         browserView = (WebView)findViewById(R.id.webkit);          //Enable Javascripts         browserView.getSettings().setJavaScriptEnabled(true);          //Removes both vertical and horizontal scroll bars          browserView.setVerticalScrollBarEnabled(false);         browserView.setHorizontalScrollBarEnabled(false);          //The website which is wrapped to the webview         browserView.loadUrl("http://dev.openlayers.org/sandbox/camptocamp         /mobile/trunk/examples/iol-iui.html?rev=9962#_map");      } } 

And here's the main.xml contents

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     > <WebView       android:id = "@+id/webkit"     android:layout_width="fill_parent"      android:layout_height="fill_parent"       /> </RelativeLayout> 

You would then have to compile and load it to your device via USB.

like image 137
Sandwich Avatar answered Sep 30 '22 09:09

Sandwich


If I understand what you're asking for, on Windows Phone 7 you cannot get such an application approved in the Microsoft Marketplace. Section 2.10 of the Application Certification Requirements for Windows Phone says "Your application must have distinct, substantial and legitimate content and purpose. Your application must provide functionality other than launching a webpage."

A colleague of mine recently had a similar style application rejected by Apple for just that reason.

I think that on both platforms you may have been able to get these kinds of applications accepted in the past, but no longer.

like image 43
Visual Stuart Avatar answered Sep 30 '22 11:09

Visual Stuart