1. Download our Official Android App: Forums for Android!

Apps Shortcut

Discussion in 'Android Development' started by TotalMusic, Mar 22, 2011.

  1. TotalMusic

    TotalMusic Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    7
    Joined:
    Mar 22, 2011

    Mar 22, 2011
    7
    0
    5
    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
     

    Advertisement

  2. cr5315

    cr5315 Android Enthusiast
    Rank:
    None
    Points:
    68
    Posts:
    434
    Joined:
    Jul 23, 2010

    Jul 23, 2010
    434
    158
    68
    Narnia
    It's not that hard.

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

    example.java
    Code (Text):
    1.  
    2. public class example extends Activity {
    3.     /** Called when the activity is first created. */
    4.     @Override
    5.     public void onCreate(Bundle savedInstanceState) {
    6.         super.onCreate(savedInstanceState);
    7.         setContentView(R.layout.main);
    8.        
    9.         Uri uri = Uri.parse("www.example.com");
    10.         Intent intent = new Intent(Intent.ACTION_VIEW, uri);
    11.         startActivity(intent);
    12.     }
    13. }
    14.  
    AndroidManifest.xml
    Code (Text):
    1.  
    2. ...
    3. </activity>
    4.  
    5.     </application>
    6.     <uses-permission android:name="android.permission.INTERNET" />
    7. </manifest>
    8.  
    That should launch the site.
     
  3. TotalMusic

    TotalMusic Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    7
    Joined:
    Mar 22, 2011

    Mar 22, 2011
    7
    0
    5
    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.
     

Share This Page

Loading...