iwek
iwek

Reputation: 1608

Android app that just points to a URL

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...

Upvotes: 23

Views: 57939

Answers (7)

Codemaker2015
Codemaker2015

Reputation: 15679

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);

Upvotes: 0

VSim
VSim

Reputation: 161

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.

Upvotes: 3

Seliya Hilal
Seliya Hilal

Reputation: 35

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/");
}

Upvotes: 3

Jon
Jon

Reputation: 11

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.

Upvotes: 1

Mark
Mark

Reputation: 7625

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

Upvotes: 3

Cristian
Cristian

Reputation: 200160

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.

Upvotes: 11

xil3
xil3

Reputation: 16449

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);

Upvotes: 32

Related Questions