Post Reply 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making an app from a website
Author Message
Deak Phreak Offline

Posts: 16
Joined: Mar 2013
Reputation: 1
Post: #1
Making an app from a website
Download the SDK

Load Eclipse

Choose a workspace

Choose a new Android Application Project

Give it an App Name, Project Name and Package Name
App: Crochet By Allie Orders
Project: CrochetByAllieOrders
Package: com.spiffynetwork.crochetbyallieorders

Leave everything else as is and hit next

Leave everything as is and hit next

Choose a logo and hit next

Choose Fullscreen Activity and hit next

Hit Finish

It may load a graphical view by default. Below the graphical stuff there should be a tab that says activity_fullscreen.xml which you can click on to view the source

Edit the following files with the following code:

Replace the <uses-sdk section with following
<uses-permission android:name="android.permission.INTERNET" />

        android:targetSdkVersion="10" />

<?xml version="1.0" encoding="utf-8"?>
        android:visibility="visible" >
        android:visibility="gone" />

edit the URL inside to point to where you want the app to load. Also replace the first line with your correct package name
package com.spiffynetwork.xbmc;

import android.annotation.SuppressLint;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;

public class FullscreenActivity extends Activity { WebView mWebView; ProgressBar pd = null;

    public void onCreate(Bundle savedInstanceState) {
      getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        pd = (ProgressBar) findViewById(;
        //final TextView tv = (TextView)findViewById(;  
        mWebView = (WebView) findViewById(;
        mWebView.setWebViewClient(new WebViewClient());        
        mWebView.setWebChromeClient(new WebChromeClient() {
            public void onProgressChanged(WebView view, int progress) {
               if(progress < 100 && pd.getVisibility() == ProgressBar.GONE){
               if(progress == 100) {

    public boolean onCreateOptionsMenu(Menu menu)
        MenuInflater menuInflater = getMenuInflater();
        menuInflater.inflate(, menu);
        return true;

    public boolean onOptionsItemSelected(MenuItem item)
        switch (item.getItemId())
        return true;

    protected void doExit() {
        new AlertDialog.Builder(this)
        .setMessage("Are you sure you want to exit?")
        .setPositiveButton("Yes", new DialogInterface.OnClickListener()
            public void onClick(DialogInterface dialog, int which) {
        .setNegativeButton("No", null)

    public void onBackPressed(){                  
        } else {

    class ClassWebViewClient extends WebViewClient {
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            return super.shouldOverrideUrlLoading(view, url);

Right click on the layout folder and choose New -> Android XML File. In the File field, type in "menu_options.xml" and choose the Resource Type to "Menu". Click Finish

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="">
    <!-- Single menu item
         Set id, icon and Title for each menu item
    <item android:id="@+id/menu_refresh"
          android:title="Refresh" />

    <item android:id="@+id/menu_exit"
          android:title="Exit" />

Once you are done, you can either right click on the main folder in the left window and choose Android Tools / Export unsigned package, then use a signing tool to sign it, or click on the play icon in the toolbar if you have a virtual emulator setup (AVD) and once run in there, you should have a package in your workspace/APP/bin folder. For example, mine would be in "C:\Users\Deak Phreak\workspace\CrochetByAllieOrders\bin"

Spiffy Network
08-06-2013 10:15 AM
Find all posts by this user Quote this message in a reply
Post Reply 

Follow Us...

Spiffy Directory