これは少し簡単に聞こえるかもしれませんが、残念ながらチュートリアルが見つかりませんでした。アイコンをクリックするとモバイルブラウザーで URL が開くシンプルなモバイルアプリ (iOS および Android) を作成しようとしています。
モバイルブラウザでURLを開くとアイコンとそのアイコンをインストールするだけのアプリでこれを行う簡単な方法はありますか.
PS。ブックマークオプションは知っていますが、アプリとして使いたいです。
ありがとうございました。
I'm not sure of the point, however I guess the following would work. You'd still have your app running in the background, as that is how Android lifecycle works.
So, I'd go ahead and create your default application with a 'blank' activity. Once done, all you'd have to do, is ensure that you launch the browser intent when the app is created. I haven't tested this code, but I'm sure it'll work (with little to no debugging):
You need to specify the url to browse to:
Uri urlToBrowse = Uri.parse("YOUR_URL_GOES_HERE");
Then you will need to create an intent for the browser:
Intent browser = new Intent(Intent.ACTION_VIEW, urlToBrowse);
Finally you'll need to start the new activity:
startActivity(browser);
Other than that, you'll have to play about with it. A little more information would have been wonderful, but this should get you started at least.