1 May 2015

Decompiling Android apk file to java and XML Step by Step (Part-2)

In the previous post we learned to decompile Java Files from the apk. Now we will continue further and extract xml and all other resources from the apk (SoundDemo.apk)

Step 1 : We stored the extracted java files in Decompiled soundDemo folder. Now Copy SoundDemo.apk and framework-res.apk in apktool->apktool folder.


Step 2 : Open Command Prompt and type the command below.
1) cd pathtoapktoolfolder
2) apktool if framework-res.apk
3) apktool d "pathtoapktoolfolder/SoundDemo.apk"
Replace pathtoapktoolfolder with path to apktool folder for your computer.
command line

Step 3 : A folder SoundDemo will be formed in apktool->apktool folder. All the extracted contents will be in that folder. Copy all contents of SoundDemo folder in Decompiled SoundDemo folder.
tools decompile

Step 4 : Delete the smali folder and here you get all the decompiled contents of SoundDemo.apk file in Decompiled SoundDemo folder
smali folder

Stay Tuned with Made In Android

Published By:
Unknown
on 1.5.15

Decompiling Android APK to java and XML files Step by Step (Part-1)

Here we will Learn how to decompile an apk file Softwares required are listed below:

Softwares Link Size
Desired APK
(SoundDemo.apk)
https://github.com/yatinkode/SoundDemo.git 2 Mb
apktool https://my.pcloud.com/publink/show?code=Hk2 30Mb
framework-res.apk https://www.androidfilehost.com/?fid=23212708291677144 10.4Mb
jdk1.7 http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html 138Mb
dex2jar.zip https://dex2jar.googlecode.com/files/dex2jar-0.0.9.15.zip 1.60Mb

Step 1 : Copy all the downloaded softwares in a folder. Create a New Folder in the same folder.
download software

Step 2 : Extract all the softwares from their zip to the same folder(decompiling).
extract all

Step 3 : Rename the apk (SoundDemo.apk) to SoundDemo.apk.rar. Remove SoundDemo.apk from the folder but don't delete it.
rename rar

Step 4 : Extract the rar file to a folder named SoundDemo
extract sounddemo

Step 5 : You will find following contents in SoundDemo folder.
in folder

Step 6 : Copy all the contents from SoundDemo to New Folder.
copy content

Step 7 : Here are the contents in dex2jar folder.
in dex2jar

Step 8 : Copy all these contents in New Folder. Remember now there are contents of SoundDemo and dex2jar folders in New Folder currently.
in newfolder

Step 9 : Open Command Prompt and go to location of New Folder by typing following 2 commands:
1) cd pathtoNewFolder 
2) dex2jar classes.dex
Replace pathtoNewFoder with actual path to New Folder from your computer.
path to

Step 10 : Now copy classesdex2jar.jar from New Folder to outside folder (decompiling folder).
classes dex2jar
from above

Step 11 : Bring the removed SoundDemo.apk back to our folder.
apk file

Step 12 : Run the .exe file found in jd-gui folder.
exe file

Step 13 : Drag classes.dex2jar.jar to java decompiler.
java decompiler

Step 14 : Click on File->Save All Sources.
in classes

Step 15 : Give name as classes_dex2jar.src.zip an save it in same folder.
make zip

Step 16 : Extract classes_dex2jar.src.zip to a folder classes_dex2jar.src in same folder.
make folder

Step 17 : Make a New Folder named Decompiled SoundDemo and copy contents in classes_dex2jar.src folder to Decompiled SoundDemo folder.
decompiled sounddemo
decompiled sounddemo

The java resources of SoundDemo are extracted. The xml resources will be extracted in the next post.

Stay Tuned with Made In Android

Published By:
Unknown
on 1.5.15

23 April 2015

Progress Spinner in Dialog Fragment in Android

spinner logo
What we will do ?
->In this tutorial we will make a button which when pressed opens a dialogbox with spinner for sometime and then open another page.

What we need ?
  • An activity with a Button(activity_main.xml)
  • An activity with progress bar(activity_progressbar.xml)
  • An activity with result page(activity_finalpage.xml)
  • styles.xml
  • Java Classes to handle all three activities(MainActivity.java, DialogFrag.java, FinalPage.java)
  • Some additions in AndroidMainfest.xml
Step 1 : Create a new application by visiting File->New->Android Application Project.
make project

Step 2 : Give a Name to your Application (ProgressSpinnerdialog) and a package name(mia), then click on Next continuously then click Finish.

Step 3 : Make a button in activity_main.xml in a Linear Layout.
activity main
 Code for activity_main.xml is shown below.

activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical"
      android:paddingLeft="50dp"
      android:paddingRight="50dp"
      android:paddingTop="10dp" >
      <Button
         android:id="@+id/Button01"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:text="Click to launch" >
      </Button>
      </LinearLayout>
Step 4 : Make a new Android XML File in res->layout and name it as activity_progressbar.xml.
layout
activity_progressbar.xml
<?xml version="1.0" encoding="utf-8"?>
   <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:orientation="horizontal" >
      <ProgressBar
         android:id="@+id/progress_bar_only"
         style="@style/ProgressBar.Spinner.Indeterminate.Small"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
         android:layout_weight="1"
         android:max="200"
         android:paddingBottom="1dp"
         android:paddingLeft="20dp"
         android:paddingRight="10dp"
         android:paddingTop="1dp" />
      <TextView
         android:id="@+id/waiting"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_weight="1"
         android:ems="10"
         android:paddingBottom="1dp"
         android:paddingLeft="20dp"
         android:paddingTop="1dp"
         android:text="waitText"
         android:textSize="16sp" />
   </LinearLayout>

Step 5 : Make another Android XML File and name it as activity_finalpage.xml
final page
activity_finalpage.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/RelativeLayout1"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" >
      <TextView
         android:id="@+id/display_message"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_alignParentTop="true"
         android:layout_centerHorizontal="true"
         android:ems="10"
         android:paddingTop="10dp"
         android:text="Page Loaded"
         android:textSize="20sp" />
   </RelativeLayout>

Step 6 : Go to res->values->styles.xml and copy the code below in it.

styles.xml
<resources>
      <style name="AppBaseTheme" parent="android:Theme.Light">
      </style>
      <!-- Application theme. -->
      <style name="AppTheme" parent="AppBaseTheme">
         <!-- All customizations that are NOT specific to a particular API-level can go here. -->
      </style>
      <style name="ProgressBar.Spinner.Indeterminate.Small" parent="@android:style/Widget.Holo.Light.ProgressBar.Small">
         <item name="android:layout_width">wrap_content</item>
         <item name="android:layout_height">wrap_content</item>
         <item name="android:indeterminate">true</item>
      </style>
   </resources>

Step 7 : Go to src->com.mia.progressspinnerdialog ->.MainActivity.java

MainActivity.java
package com.mia.progressspinnerdialog;
  
   import android.app.Activity;
   import android.os.Bundle;
   import android.widget.Button;
   import android.widget.ProgressBar;
   import android.view.View;
   import android.view.View.OnClickListener;
  
   public class MainActivity extends Activity {
  
         int typeBar;                                
         ProgressBar progDialog;
         Button button1;
         DialogFrag fragment;
  
         @Override
         public void onCreate(Bundle savedInstanceState) {
                  super.onCreate(savedInstanceState);
                  setContentView(R.layout.activity_main);
                  button1 = (Button) findViewById(R.id.Button01);
                  button1.setOnClickListener(new OnClickListener(){
                           public void onClick(View v) {
                                 typeBar = 0;
                                 DialogFrag.context = getApplicationContext();
                                 fragment = DialogFrag.newInstance(typeBar); 
                                 fragment.show(getFragmentManager(), "Task 1");           
                           }
                  }); 
         } 
   }

Step 8 : Make a new class in src->com.mia.progressspinnerdialog and name it as DialogFrag. Copy the below code in it.

DialogFrag.java
package com.mia.progressspinnerdialog;
   
   import android.app.DialogFragment;
   import android.app.ProgressDialog;
   import android.os.Bundle;
   import android.os.Handler;
   import android.os.Message;
   import android.util.Log;
   import android.view.LayoutInflater;
   import android.view.View;
   import android.view.ViewGroup;
   import android.widget.ProgressBar;
   import android.content.Context;
   import android.content.Intent;
   
   public class DialogFrag extends DialogFragment {
   
         ProgressDialog progDialog;
         ProgressBar pbar;
         public static Context context;
         int barType;
         View v;
         private ProgressThread progThread;
         private static final int delay = 20;         
         private int maxBarValue;                     
         boolean threadStopped = false;
         boolean lightTheme = true;                   
     public DialogFrag() {        
     }
         static DialogFrag newInstance(int num) {
                  DialogFrag f = new DialogFrag();
                  Bundle args = new Bundle();
                  args.putInt("num", num);
                  f.setArguments(args);
                  return f;
         }
         public void onCreate(Bundle savedInstanceState){
                  super.onCreate(savedInstanceState);
                  barType = getArguments().getInt("num");
                  int style = DialogFragment.STYLE_NO_TITLE;
                  int theme = android.R.style.Theme_Holo_Dialog;
                  if(lightTheme){
                           theme = android.R.style.Theme_Holo_Light_Dialog;
                  }
                  this.setStyle(style, theme);  
         }
         @Override
         public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
                  if(barType == 0){
                           v = inflater.inflate(R.layout.activity_progressbar, container, false);
                           pbar = (ProgressBar) v.findViewById(R.id.progress_bar_only);
                  } 
                  maxBarValue = pbar.getMax();
                  progThread = new ProgressThread(handler);
                  progThread.start();
                  return v;
         }
         @Override
         public void onDestroy(){
                  super.onDestroy();
         }
         private void closeDialog(){
                  if(!threadStopped){
                           Intent i = new Intent(context, FinalPage.class);
                           startActivity(i);
                           if(!this.isDetached()) dismiss();
                  }
         }
         final Handler handler = new Handler() {
                  public void handleMessage(Message msg) {
                           int total = msg.getData().getInt("total");
                           pbar.setProgress(total);
                           if (total > maxBarValue){
                                 progThread.setState(ProgressThread.DONE);
                                 pbar.setVisibility(ProgressBar.INVISIBLE);
                                 v.setVisibility(View.INVISIBLE);
                                 closeDialog();
                                 threadStopped = true;
                           }
                  }
         };
         private class ProgressThread extends Thread {    
                  final static int DONE = 0;
                  final static int RUNNING = 1;
   
                  Handler mHandler;
                  int mState;
                  int total;
                  ProgressThread(Handler h) {
                           mHandler = h;
                  }
                  @Override
                  public void run() {
                           mState = RUNNING;   
                           total = 0;
                           threadStopped = false;
                           while (mState == RUNNING) {
                                 try {
                                          Thread.sleep(delay);
                                 } catch (InterruptedException e) {
                                          Log.e("ERROR", "Thread was Interrupted");
                                 }
                                 Message msg = mHandler.obtainMessage();
                                 Bundle b = new Bundle();
                                 b.putInt("total", total);
                                 msg.setData(b);
                                 mHandler.sendMessage(msg);   
                                 total++; 
                           }
                  }
                  public void setState(int state) {
                           mState = state;
                  }
         }
   }

 Step 9 : Make a new class in src->com.mia.progressspinnerdialog and name it as FinalPage. Copy the below code in it.

FinalPage.java
package com.mia.progressspinnerdialog;
  
   import android.os.Bundle;
   import android.support.v4.app.FragmentActivity;
  
   public class FinalPage extends FragmentActivity {
  
         @Override
         public void onCreate(Bundle savedInstanceState) {
                  super.onCreate(savedInstanceState);
                  setContentView(R.layout.activity_finalpage); 
         }
   }

Step 10 : Make changes in AndroidManifest.xml as shown below.

AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.mia.progressspinnerdialog"
    android:versionCode="1"
    android:versionName="1.0" >
    <uses-sdk
        android:minSdkVersion="13"
        android:targetSdkVersion="16" />
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.mia.progressspinnerdialog.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
               android:name=".DialogFrag"
               android:label="DialogFragment" >
         </activity>
                  <activity
               android:name=".FinalPage"
               android:label="FinalPage" >
         </activity>
    </application>
</manifest>

Step 11 : Run the Project.
output mobile
output emulator

Explanation of the code :

Explanation from activity_main.xml :
  • We have a button with id Button01 in a Linear Layout.
Explanation from activity_progressbar.xml :
  •  We have a ProgressBar with a TextView in a Linear Layout.The style of progress bar is defined from styles.xml.
  • android:max defines the maximum value for the progress.
<ProgressBar
         android:id="@+id/progress_bar_only"
         style="@style/ProgressBar.Spinner.Indeterminate.Small"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
         android:layout_weight="1"
         android:max="200"
         android:paddingBottom="1dp"
         android:paddingLeft="20dp"
         android:paddingRight="10dp"
         android:paddingTop="1dp" />
Explanation from activity_finalpage.xml :
  •  We have a Text displayed on a simple Relative Layout.
Explanation from MainActivity.java :
  • We define an integer variable named typeBar, a ProgressBar variable progDialog, a Button and a Dialog Fragment.
int typeBar;
ProgressBar progDialog;
Button button1;
DialogFrag fragment;

  • We use onClick() method to perform action when button is pressed. We define typeBar to value 0 to denote a spinner.
button1.setOnClickListener(new OnClickListener(){
public void onClick(View v) {
 typeBar = 0;
  • getApplicationContext() method is used to hold the specific action of the Dialog Fragment.
DialogFrag.context = getApplicationContext();
  • Then we create a new instance of  Fragment using newInstance(). We use this instance to interact with the fragment (our dialogbox with spinner and text) using getFragmentManager() method. Task 1 is the tag for the fragment.
fragment = DialogFrag.newInstance(typeBar);  
fragment.show(getFragmentManager(), "Task 1");

Explanation from DialogFrag.java :
  • Create a new instance of class DialogFrag.
static DialogFrag newInstance(int num) {
DialogFrag f = new DialogFrag();
Bundle args = new Bundle();args.putInt("num", num);
f.setArguments(args);
return f;
}
  • Define theme for the dialog-box
int style = DialogFragment.STYLE_NO_TITLE;
int theme = android.R.style.Theme_Holo_Dialog;
if(lightTheme){
theme = android.R.style.Theme_Holo_Light_Dialog;
}
this.setStyle(style, theme);
  • Connect pbar variable to progressbar (progress_bar_only) from the layout.
pbar = (ProgressBar) v.findViewById(R.id.progress_bar_only);
  • Get the maximum value of progress and store it in maxBarValue. Then make thread progThread and start it using start().
maxBarValue = pbar.getMax();
progThread = new ProgressThread(handler);
progThread.start();
  • Code for opening FinaPage when dialog-box closes.
private void closeDialog(){
if(!threadStopped){
Intent i = new Intent(context, FinalPage.class);
startActivity(i);
if(!this.isDetached()) dismiss();
  • Handler displays the message in the dialog-box. getInt() gets integer value of text and compares it with maxBarValue. If it is higher the dialog-box will disappear.
final Handler handler = new Handler() {
public void handleMessage(Message msg) {
int total = msg.getData().getInt("total");
pbar.setProgress(total);
if (total > maxBarValue){
progThread.setState(ProgressThread.DONE);
pbar.setVisibility(ProgressBar.INVISIBLE);
v.setVisibility(View.INVISIBLE);
closeDialog();
threadStopped = true;
  • All other code is simple java thread code.
Explanation from FinalPage.java
  • It opens the layout activity_finalpage when class object is called.
setContentView(R.layout.activity_finalpage);
Stay Tuned with Made In Android

Published By:
Yatin Kode
on 23.4.15

11 April 2015

Add sound in Android project

What we will do ?
-> We will make 4 buttons which when clicked emits different sounds (animal sounds).

What we will need ?
  • Add buttons in activity_main.xml
  • Add sound files in resources
  • Add MediaPlayer in MainActivity.java
Step 1 : Create a New Application. Go to File->New->Android Application Project.

Step 2 : Give a name to the application (SoundDemo) and a package name(mia). Click Next continuously the click Finish.

Step 3 : Add 4 buttons to activity_main.xml from the Palette OR copy the below code in it. Give specific ids to the buttons so that you can remember it to add it in MainActivity.java.
activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity"
    android:background="#585858" 
    android:padding="10dp">
    <Button
        android:id="@+id/buttonlion"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="20dp"
        android:background="#D8D8D8"
        android:text="Lion" />
    <Button
        android:id="@+id/buttoncat"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_below="@+id/buttonlion"
        android:layout_marginTop="20dp"
        android:background="#D8D8D8"
        android:text="Cat" />
    <Button
        android:id="@+id/buttonfrog"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_below="@+id/buttoncat"
        android:layout_marginTop="20dp"
        android:text="Frog"
        android:background="#D8D8D8" />
    <Button
        android:id="@+id/buttondog"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_below="@+id/buttonfrog"
        android:layout_marginTop="20dp"
        android:text="Dog"
        android:background="#D8D8D8" />
</RelativeLayout>


Step 4 : Download some sound files from freesound.org. You have to register and login to download files. I have downloaded the sound for lion, cat, frog and dog.

Step 5 : Add a new folder in res folder. Right-click on res->New Folder. Name it as raw. Add the sound files to it as shown below.

Step 6 : Open MainActivity.java from src->com.mia.sounddemo. Copy the code from below in it.

MainActivity.java
package com.mia.sounddemo;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        final Button buttonLion = (Button)findViewById(R.id.buttonlion);       
        final Button buttonCat = (Button)findViewById(R.id.buttoncat);
        final Button buttonFrog = (Button)findViewById(R.id.buttonfrog);      
        final Button buttonDog = (Button)findViewById(R.id.buttondog);
        
        final MediaPlayer mp1 = MediaPlayer.create(this, R.raw.lion);
        final MediaPlayer mp2 = MediaPlayer.create(this, R.raw.cat);
        final MediaPlayer mp3 = MediaPlayer.create(this, R.raw.frog);
        final MediaPlayer mp4 = MediaPlayer.create(this, R.raw.dog);
        buttonLion.setOnClickListener(new Button.OnClickListener(){
            @Override
            public void onClick(View v) {
                    mp1.start();
            }});
        buttonCat.setOnClickListener(new Button.OnClickListener(){
            @Override
            public void onClick(View v) {
                    mp2.start();
            }}); 
        buttonFrog.setOnClickListener(new Button.OnClickListener(){
            @Override
            public void onClick(View v) {
                    mp3.start();
            }});
        buttonDog.setOnClickListener(new Button.OnClickListener(){
            @Override
            public void onClick(View v) {
                    mp4.start();
            }}); 
    }           
 }


Step 7 : Run the Project. Click on each Button to hear different sounds.

Explanation of the Code :
Explanation from activity_main.xml :
  • We have made 4 different buttons with names of 4 different animals i.e. Lion, Cat, Frog, Dog. We have given specific ids to them i.e. buttonlion, buttoncat, buttonfrog, buttondog respectively.

Explanation from MainActivity.java :
  • We have made 4 Button variables namely buttonLion, buttonCat, buttonFrog and buttonDog and connected them with buttonlion, buttoncat, buttonfrog, buttondog from activity_main.xml respectively.
final Button buttonLion = (Button)findViewById(R.id.buttonlion);      
        final Button buttonCat = (Button)findViewById(R.id.buttoncat);
        final Button buttonFrog = (Button)findViewById(R.id.buttonfrog);       
        final Button buttonDog = (Button)findViewById(R.id.buttondog);
  •   We make for MediaPlayers for 4 different sounds as mp1, mp2, mp3 and mp4 for lion,cat, frog and dog respectively. We connect them with the .wav files using create().
final MediaPlayer mp1 = MediaPlayer.create(this, R.raw.lion);
        final MediaPlayer mp2 = MediaPlayer.create(this, R.raw.cat);
        final MediaPlayer mp3 = MediaPlayer.create(this, R.raw.frog);
        final MediaPlayer mp4 = MediaPlayer.create(this, R.raw.dog);
buttonLion.setOnClickListener(new Button.OnClickListener(){
            @Override
            public void onClick(View v) {
                    mp1.start();
            }});

Watch Video Tutorial:

Stay Tuned with Made In Android

Published By:
Yatin Kode
on 11.4.15

6 April 2015

Make Signin/Signup form in Android using Phonegap

 What will we do ?
-> We will make a Web Based App using HTML, CSS etc. and build it on above 4 mobile platforms. Our App will be a login page (index.html) and signup page (signup.html)

What we will need ?
  • An App based on HTML, CSS etc.
  • Adobe ID
  • 7 Zip for zip compression.
  • All 4 platform mobiles to test the App.
Step 1 : Download 7Zip for zip compression.

Step 2 : Make a HTML based website. It must be responsive type to fit properly in your mobile device. You can use Mobile JQuery tools for building the App. I'll use the short example below. You can add any number of files of type css,js ,html etc.

NOTE : There must be a file named index.html. Without index.html you will not be able to build your application.

Step 3 : Make 2 html pages index.html and signup.html. Add the below code to both the pages . Our App will look like these in the browser.
index.html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>

<div data-role="page" id="pageone">
  <div data-role="header">
    <h1>Welcome To My Homepage</h1>
    <div data-role="navbar">
      <ul>
        <li><a href="#">Login</a></li>
        <li><a href="signup.html">SignUp</a></li>
      </ul>
    </div>
  </div>

  <div data-role="main" class="ui-content">
    <p><h1>Login</h1>
  </div>
  <div class="form-group">
    <label for="email">Email address:</label>
    <input type="email" class="form-control" id="email">
  </div>
  <div class="form-group">
    <label for="pwd">Password:</label>
    <input type="password" class="form-control" id="pwd">
  </div>
  <div class="checkbox">
    <label><input type="checkbox"> Remember me</label>
  </div>
  <button type="submit" class="btn btn-default">Submit</button>
</form>
</p>
  </div>

  <div data-role="footer">
    <h1>My Footer</h1>
  </div>
</div> 

</body>
</html>

signup.html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>

<div data-role="page" id="pageone">
  <div data-role="header">
    <h1>Welcome To My Homepage</h1>
    <div data-role="navbar">
      <ul>
        <li><a href="index.html">Login</a></li>
        <li><a href="#">SignUp</a></li>
      </ul>
    </div>
  </div>


<div data-role="main" class="ui-content">
    <p><h1>SignUp</h1>
 <br>

 <form role="form">  
<div class="form-group">
  <label for="usr">Name:</label>
  <input type="text" class="form-control" id="usr">
</div>
<div class="form-group">
    <label for="email">Email address:</label>
    <input type="email" class="form-control" id="email">
  </div>
  <div class="form-group">
    <label for="pwd">Password:</label>
    <input type="password" class="form-control" id="pwd">
  </div>
  <div class="form-group">
    <label for="pwd">Repeat Password:</label>
    <input type="password" class="form-control" id="pwd">
  </div>
Gender
<div class="radio">
  <label><input type="radio" name="optradio">Male</label>
</div>
<div class="radio">
  <label><input type="radio" name="optradio">Female</label>
</div>
  <button type="submit" class="btn btn-default">Submit</button>
</form>

  <div data-role="footer">
    <h1>Copyright</h1>
  </div>
</div> 
</p></div>
</body>
</html>

Step 4 : Go to https://build.phonegap.com/ and click Get Started. Choose free plan.

 Sign in with your Adobe Account OR SignUp first if you do not have one.

Step 5 :  Add index.html and signup.html in a folder (websiteapp) and make it as .zip file. Only .zip format is allowed.

Step 6 : Upload it to you Account

Step 7 : Download .apk file, .xpa, .ipa Install it and Run It.

Stay Tuned with Made In Android

Published By:
Unknown
on 6.4.15

Previous Page Next Page Home
Top