Skip to main content

Sample Android Application using Cordova

  •  Creating Sample Android Program using Corodova

    Step 1: 
    Download Android SDK

    http://developer.android.com/sdk/index.html
    http://developer.android.com/sdk/index.html#download

    Add platform-tools and tools to system path

    • adt\sdk\tools
    • adt\sdk\platform-tools



    Open Eclipse and Configure android sdk

    Add jre & Jdk Path to system path

    Step 2:
     Download Apache ANT

    http://ant.apache.org/bindownload.cgi

    Extract and copy ant files to C: drive

    Add ant path to system Properties



    Add JAVA_HOME path to system Properties






    Step 3
    Create Android Application


    • Install Cordova
    Paste this code in command prompt
                    " npm install -g cordova "

    Before that install noje js for npm access




    • Map to A folder where android project to be created
    Type cmd command

    " cordova create <PROJECT NAME> <PACKAGE NAME> <PROJECT NAME> "

    eg: D:\Androi>cordova create Audio com.myaudio.app Audio



    • Map to newly created folder
    Type cmd command

    " cordova platform add android "

    eg: D:\Androi\Audio>cordova platform add android


    • Add Cordova Plugins to your project  
    refer Cordova doc for necessary plugins for your projects

    https://cordova.apache.org/docs/en/2.9.0/cordova_media_media.md.html#Media


    eg: D:\Androi\Audio>cordova plugin add org.apache.cordova.media



    • Build Cordova app


    Type cmd command

    " cordova build "

    eg: D:\Androi\Audio>cordova build


    • Now android assets folder with files created

    sample eg: D:\Androi\Audio\platforms\android\assets

    • Now you can change the index.html files with your own requirements

    Step 4

    Import project into eclipse

    Two projects will be imported to eclipse
    then run

    ENJOY CODING..!!!


    For More Reference https://www.youtube.com/watch?v=6hjvZlIR1EE

Comments

Popular posts from this blog

Bluetooth Chat Example

Manifest File <manifest xmlns:android="http://schemas.android.com/apk/res/android"       package="com.example.android.BluetoothChat"       android:versionCode="1"       android:versionName="1.0">     <uses-sdk minSdkVersion="7" />     <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />     <uses-permission android:name="android.permission.BLUETOOTH" />     <application android:label="@string/app_name"                  android:icon="@drawable/app_icon" >         <activity android:name=".BluetoothChat"                   android:label="@string/app_name"                   android:configChanges="orientation|keyboardHidden">             <intent-filter> ...

Custom TextView With Images in Android

Create a custom XML Tag with image and text 1) Class extends Textview import java . util . regex . Matcher ; import java . util . regex . Pattern ; import android . content . Context ; import android . text . Spannable ; import android . text . style . ImageSpan ; import android . util . AttributeSet ; import android . util . Log ; import android . widget . TextView ; public class TextViewWithImages extends TextView { public TextViewWithImages ( Context context , AttributeSet attrs , int defStyle ) { super ( context , attrs , defStyle ); } public TextViewWithImages ( Context context , AttributeSet attrs ) { super ( context , attrs ); } public TextViewWithImages ( Context context ) { super ( context ); } @Override public void setText ( CharSequence text , BufferType type ) { Spannable s = getTextWithImages ( getContext (), text ); super . setText...

AcceleroMeter Sensors with SurfaceMovements on Canvas

MainActivity.java import android.app.Activity; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Bundle; import android.util.Log; import android.view.SurfaceHolder; import android.view.SurfaceView; public class MainActivity extends Activity implements SensorEventListener { float x, y, sensorX, sensorY; Bitmap ball; SensorManager sm; Sensor s; MyBringBackSurface ourSurfaceView; /**  * Canvas Movement  */ public class MyBringBackSurface extends SurfaceView implements Runnable {     SurfaceHolder ourHolder;     Thread ourThread = null;     boolean isRunning = false;     public MyBringBackSurface(Context context) {         super(context)...