43

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.

EnexoOnoma
  • 8,454
  • 18
  • 94
  • 179
  • 12
    I don't understand the down votes. It seems like a reasonable question to ask. In fact our customers ask for this all the time. So what am I missing that makes this question get down votes? Not picking a fight, just curious. Peace. – Visual Stuart Nov 12 '11 at 04:10
  • 1
    I didn't downvote. But you are asking for help making an app that will currently get rejected by Apple and Microsoft. Not good for your customers. Maybe if you ask about doing this specifically just for your own personal use, or maybe wanting to add some features beyond just a web page? – hotpaw2 Nov 12 '11 at 06:39
  • Is this all your app is doing or do you just need to show a webpage within your application at some point? – Walt Ritscher Nov 12 '11 at 07:48
  • 1
    @hotpaw2 Yes, but just because the answer is "you can't do that" doesn't mean the question is unclear or not useful (= my understanding of what a down vote means). It's not my question (OP = @ntopia) but as a consultant I get some form of the question frequently from customers. It's a useful question, but the answer is "no." So again, I don't understand the down votes. – Visual Stuart Nov 12 '11 at 12:44
  • 6
    Because as aweosme as stackoverflow is, people's scores have a tendency to facilitate a 'know-it-all' syndrome. "Why do you want to do this? YOu should do it like this..." But of course, sometimes people do unconventional things for the RIGHT reasons... Who says it needs to be approved by marketplace!?!?! – Sandwich May 02 '13 at 23:43

6 Answers6

17

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.

Sandwich
  • 2,304
  • 3
  • 24
  • 30
  • Google Play doesn't approve apps. – tupakapoor Mar 16 '17 at 15:45
  • Indeed, as stated in the last line of this answer "Google Play would be unlikely to approve such an app." – Sandwich Mar 22 '17 at 00:12
  • 1
    That statement, "Google Play would be unlikely to approve such an app.", implies Google Play would disprove of such an app. Therefore implying that it wouldn't be able to be in the store. Google Play would be unlikely to approve ANY app, because they don't approve apps. There is no approval process. – tupakapoor Apr 06 '17 at 04:53
  • Ah, when this was written, Google Play had "Quality Guidelines" and at the time an app like this did not meet them. Thanks for the information – Sandwich Apr 06 '17 at 15:02
6

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.

Visual Stuart
  • 661
  • 4
  • 10
  • What about an hybrid aproach? Having a left menu with some filtering options of an online-shop invoking a new request using get or post. Or saving login informations in the app and setting the web session on startup? – djmj Apr 05 '14 at 02:21
  • 2
    Here's an updated link for the requirements. This is still section 2.10 so read that carefully. Caching login credentials does not seem to me to be distinct content or purpose. In general, I would advise against trying to cut corners or get too "cute" when meeting application guidelines. Make it a true hybrid app and you are probably good, a superficial hybrid is going to be a tough sell. http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh184841(v=vs.105).aspx – Visual Stuart Apr 07 '14 at 18:06
  • Here is Apples position to simple web wrappers: https://developer.apple.com/app-store/review/guidelines/#minimum-functionality – Atan Feb 05 '18 at 13:03
2

For iOS/iPhone, you can encapsulate a web app or web page inside an app's bundle, and display the site inside a full-height UIWebView. To add non-HTML5 features (which may be required for Apple to approve the app for their App store distribution), you can trap custom URLs via the shouldStartLoadWithRequest: delegate method and handle them with native Object C code.

hotpaw2
  • 70,107
  • 14
  • 90
  • 153
1

There's a lot of general information out there in regards to Regular Webapps vs hybrid apps (web but designed for mobile) vs mobile apps (client software). What you're probably looking for is just typical HTML5 or mobile compliant web code.

For android, this is a good read: http://developer.android.com/guide/webapps/index.html

dispake
  • 3,259
  • 2
  • 19
  • 22
1

For android, you will want to use a WebView.

Nightfirecat
  • 11,432
  • 6
  • 35
  • 51
josephus
  • 8,284
  • 1
  • 37
  • 57
0

If you are not a programmer and you're looking for a quick fix, nativator.io is the go-to wrapper, it offers most native features and support both android and ios.

Sam
  • 1
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/31231782) – Abhishek Dutt Mar 10 '22 at 04:57