22

If I build a website that is designed and developed for android or just the droid, is it possible to just make an app that will directly point to that url? or is that not considered an app because it will open in the droid browser etc...

iwek
  • 1,608
  • 5
  • 16
  • 31
  • On a side note, your app submission might get rejected (most likely) if it is going to be just a wrapper for a website and nothing else. The review team asked me to prove that I am the actual owner of the website. Once I proved, they allowed me to publish the app in play store. – Janaaaa Dec 28 '18 at 12:46

7 Answers7

32

You can't create a link in Android - you'd have to make an app that automatically opens the browser up and goes to the specified URL when opened.

Something like this in the onCreate:

Intent browserIntent = new Intent("android.intent.action.VIEW", Uri.parse("http://www.google.com"));
startActivity(browserIntent);
xil3
  • 16,305
  • 8
  • 63
  • 97
  • 12
    Love this site to death, but some people are just morons! If you're going to down-vote me, at least have the guts to tell me what I did wrong. As far as I'm concerned, that answer is very accurate and is exactly what I'd do. – xil3 Jan 25 '11 at 15:30
  • i did not down vote you, but I like what Cristian is saying about using WebView – iwek Jan 25 '11 at 16:23
  • @iwek Wasn't saying you did, but someone did. And the WebView isn't the best approach for this. It may work, but it's a website, and that's what the browser is for. – xil3 Jan 25 '11 at 16:30
  • 1
    Thanks! Some people may find this answer or its Eclipse comment helpful as well: http://stackoverflow.com/a/6652832/425767 – groovenectar Jun 08 '12 at 19:37
  • 1
    @iwek the thing that sucks about using WebView is that you have to handle all of the details manually like file uploading and handle all of its quirks like the page refreshing on device orientation change. It's definitely not the same experience you'd get using the Chrome browser. – The Muffin Man Dec 05 '14 at 16:53
  • The problem with this solution is that you will need a steady internet connection. You can use a html5 cache manifest but it's hard and the user must first visit the page before it can be cached. To me, to do this is totally useless unless you are adding some extra functionality. – Codebeat May 25 '15 at 20:23
  • The best use case for this that I've seen is when your web app requires native app functionality and wiring up a webview requires extra programming to add those native bits of functionality. If your users just need a way to add the "App" to their home screen or the ability to find your web app by searching in the Play store or App store, then this is a good solution. (Most users don't know they can add a web app to their home screen) – codescribblr Jul 07 '16 at 14:21
11

It's considered an app because the result will be an independent APK (which you can distribute in the Market). You don't have to launch the droid browser; rather, you use WebView to embed the site on your app.

Cristian
  • 198,401
  • 62
  • 356
  • 264
  • thanks man, that is very helpful. any good resources/examples for WebView or do I just browse http://developer.android.com/reference/android/webkit/WebView.html ? – iwek Jan 25 '11 at 16:22
3

use webview in android

{
WebSettings webSettings = mWebView.getSettings();
mWebView.getSettings().setSupportZoom(true);
mWebView.getSettings().setBuiltInZoomControls(true);
webSettings.setJavaScriptEnabled(true);
mWebView.loadUrl("http://m.domainname.com/");
}
3

Looks like you can create a shortcut in Android. See here:

http://www.howtogeek.com/196087/how-to-add-websites-to-the-home-screen-on-any-smartphone-or-tablet/

I haven't tried it myself but others have and it seems to work.

Anyway, it's simpler and more convenient for end users to just download an app from an online store (usually Google Play). It's what they're used to do. And they do have a lot of additional info available, like what it does, what others say about it, screen shots (if you provide some for them but you should). Plus a way to comment / complain themselves. It's a different thing. Technically it may not make a lot of sense but from a simple user's perspective it's clearly better IMO. So I'd recommend the extra (small) trouble of writing a simple Webview app.

See here for a step-by-step tutorial on how to do exactly that:

http://intelnav.50webs.com/app_project.html

It's based on a Webview, that is it opens the page and does all the navigation in the app window, not in the default browser. So if you want to open it in the browser, you have to use Intent, as said in previous answers.

My 2 pennies worth, I think it's better in the app window unless you really want complex navigation with the possibility of opening additional tabs, windows and so on. The drawback with the external browser is that, as far as I could see, there's no way to tell if the page is already open in the browser so you'll launch a different copy (in a new tab) every time. If the user doesn't close the tab at the end, they usually don't, it can become quite annoying. Besides, within an app you'll probably have somewhat better possibilities for ads should you ever want them.

VSim
  • 161
  • 3
  • 10
3

You can create an Android app that just points to a URL and loads inside of the application window. But this is probably not what satisfies users. If there is no more worth (in having an extra application) - I would let the users browse the site by themselves.

You should read this article: http://developer.android.com/guide/webapps/index.html

Mark
  • 7,507
  • 12
  • 52
  • 88
1

Is WebView what AppsGeyser uses to convert an html or WordPress mobile website to an APK?

I use it (free) and it works well, but it's not as fast as a 'proper' app (beyond my capabilities as I found after trying some programs).

Any html page edits show up immediately - as on the mobile website itself - in the AppsGeyser App; no user update needed.

Jon
  • 11
  • 1
0

You can't make any hyperlinks in Android. But using the following code in the click event of any views will automatically open the links in the default browser.

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://www.mace.ac.in"));
startActivity(intent);
Codemaker2015
  • 12,190
  • 6
  • 97
  • 81