• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Shortcut

Hey.

I want make a simple application, so when people download my app on the market ( it will be free ) it directs them straight to my website. I know this is easy, but I am unsure on how todo this. Thanks very much for help
 
It's not that hard.

In you main activity, use ACTION_VIEW to launch the webpage.

example.java
Code:
public class example extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Uri uri = Uri.parse("www.example.com");
	    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
	    startActivity(intent);
    }
}

AndroidManifest.xml
Code:
...
</activity>

    </application>
    <uses-permission android:name="android.permission.INTERNET" />
</manifest>

That should launch the site.
 
It's not that hard.

In you main activity, use ACTION_VIEW to launch the webpage.

example.java
Code:
public class example extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Uri uri = Uri.parse("www.example.com");
	    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
	    startActivity(intent);
    }
}

AndroidManifest.xml
Code:
...
</activity>

    </application>
    <uses-permission android:name="android.permission.INTERNET" />
</manifest>

That should launch the site.

Thanks very much for the reply. I am currently a beginner, so I am using Android App Inventor, and have no idea how to do it.
 
Back
Top Bottom