Android, the world's most popular mobile platform

Android gives you a world-class platform for creating apps and games for Android users everywhere, as well as an open marketplace for distributing to them instantly.

ios The world’s most advanced mobile operating system.

iOS is the world’s most advanced mobile operating system, continually redefining what people can do with a mobile device. Together, the iOS SDK and Xcode IDE make it easy for developers to create revolutionary mobile apps.

Open marketplace for distributing your apps

Google Play is the premier marketplace for selling and distributing Android apps. When you publish an app on Google Play, you reach the huge installed base of Android.

Develop apps for iPhone and iPad

Create mobile apps using the programming skills, knowledge and code that you already have. Your Delphi iOS apps will have fast native performance and better security than web-based or scripting language based apps. Full visual designer for iOS user interfaces with multiple device types, resolutions, and orientations.

Powerful development framework

Android gives you everything you need to build best-in-class app experiences. It gives you a single application model that lets you deploy your apps broadly to hundreds of millions of users across a wide range of devices—from phones to tablets and beyond.

Tuesday, 2 December 2014

Customizing Progress Bar In Android

Customizing Progress Bar In Android

Progress Bar:
                                               Progress bars are used to show progress of a task. For example. When you are uploading or downloading something from the internet, it is better to show the progress of download/upload to the user.Now here am going to customize the  progress bar

How to customize the progress bar?
                                To customize the progress bar we need to define the properties of progress bar which are defined in  the xml file inside the drawable folder.


1.Open Eclipse IDE.
2.Click File -> New -> Project -> Android Application Project.
3.Enter the name of the application  as CustomizedProgressbar and click next .

4.Make sure that you have enabled the create project in workspace.
5.Design application launcher icon and create a blank activity workspace and click finish 
6.Create a folder drawable inside the res folder
7.Create a custom_progressbar.xml inside the drawable folder


The custom_progressbar.xml coding is given below:



<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

<!-- Define the background properties like color etc -->
<item android:id="@android:id/background">
<shape>
<gradient
android:angle="270"
android:centerColor="#0b131e"
android:centerY="1.0"
android:endColor="#0d1522"
android:startColor="#000001" />
</shape>
</item>

<!-- Define the progress properties like start color, end color etc -->
<item android:id="@android:id/progress">
<clip>
<shape>
<gradient
android:angle="270"
android:centerColor="#007A00"
android:centerY="1.0"
android:endColor="#06101d"
android:startColor="#007A00" />
</shape>
</clip>
</item>



</layer-list>


The activity_main.xml code is given below:


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:background="#B4E0E1"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="80dp"
android:text="CustomizedProgressbar"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<Button
android:id="@+id/button1"
android:layout_marginTop="150dp"
android:background="@drawable/button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Start Downloading File"
android:onClick="startProgressDialog"/>
</RelativeLayout>

The activity_main.xml looks as shown below:

                                                                               

The MainActivity java as shown below :


package com.example.customizedprogressbar;


import android.support.v7.app.ActionBarActivity;
import android.app.ProgressDialog;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;


public class MainActivity extends ActionBarActivity
{


ProgressDialog progressBar;
private int progressBarStatus = 0;
private Handler progressBarHandler = new Handler();


private long fileSize = 0;

@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}


public void startProgressDialog(View V)
{



// prepare for a progress bar dialog
progressBar = new ProgressDialog(V.getContext());
progressBar.setCancelable(true);
progressBar.setMessage("Downloading File...");
progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressBar.setProgress(0);
progressBar.setMax(100);

// Get the Drawable custom_progressbar
Drawable customDrawable= getResources().getDrawable(R.drawable.custom_progressbar);

// set the drawable as progress drawable


progressBar.setProgressDrawable(customDrawable);

progressBar.show();


//reset progress bar status
progressBarStatus = 0;


//reset filesize
fileSize = 0;


new Thread(new Runnable() {
public void run() {
while (progressBarStatus < 100) {


// process some tasks
progressBarStatus = fileDownloadStatus();


// sleep 1 second to show the progress
try {
Thread.sleep(1000);
}
catch (InterruptedException e) {
e.printStackTrace();
}


// Update the progress bar
progressBarHandler.post(new Runnable() {
public void run() {
progressBar.setProgress(progressBarStatus);
}
});
}


// when, file is downloaded 100%,
if (progressBarStatus >= 100) {


// sleep for 2 seconds, so that you can see the 100% of file download
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}


// close the progress bar dialog
progressBar.dismiss();
}
}
}).start();


}





//method returns the % of file downloaded
public int fileDownloadStatus()
{


while (fileSize <= 1000000) {


fileSize++;


if (fileSize == 100000) {
return 10;
} else if (fileSize == 200000) {
return 20;
} else if (fileSize == 300000) {
return 30;
}
else if (fileSize == 400000) {
return 40;
} else if (fileSize == 500000) {
return 50;
} else if (fileSize == 600000) {
return 60;
}
// write your code here


}


return 100;


}
}









Now Run the project and check the result  ,the result will shown as below.
                                           
                                                                 

Thursday, 18 September 2014

Using Custom Fonts in Android

Using Custom Fonts in Android
                                     


Here you are going to know that how to use external fonts in Android

1.Open Eclipse IDE.
2.Click File -> New -> Project -> Android Application Project.
3.Enter the name of the application  as openactivity and click next .
4.Make sure that you have enabled the create project in workspace.
5.Design application launcher icon and create a blank activity workspace and click finish 

Now you need to design your xml file .
Activity_main.xml
Here is the coding of 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"
    android:gravity="center"
    tools:context="com.example.androidcustomfont.MainActivity" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:text="@string/mobile"
        android:textSize="35sp" />

    <TextView
        android:id="@+id/textView2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView1"
        android:gravity="center"
        android:text="@string/And"
        android:textSize="35sp" />

</RelativeLayout>

Asset
 We are going to access the fonts using this asset folder ,create a new folder under asset and named it as fonts and copy the font you needed  inside the fonts folder as shown below.
                                               
String.xml
The string.xml file is shown below the value for the textview is passed through the string.
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">AndroidCustomFont</string>
    <string name="hello_world">Hello world!</string>
    <string name="action_settings">Settings</string>
    <string name="mobile">Mobileapptechnology</string>
    <string name="And">Android</string>

</resources>



MainActivity.java
Here the coding of MainActivity.java here we going to set the fonts to the textview which we copied it in the fonts folder under asset. 
package com.example.androidcustomfont;

import android.support.v7.app.ActionBarActivity;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;


public class MainActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        TextView tx = (TextView)findViewById(R.id.textView1);
        TextView tx1 =(TextView)findViewById(R.id.textView2);
        Typeface tf1= Typeface.createFromAsset(getAssets(), "fonts/complex.ttf");
        tx1.setTypeface(tf1);
        Typeface tf= Typeface.createFromAsset(getAssets(), "fonts/Disguise.otf");
        tx.setTypeface(tf);
    }


    }
The typeface class specify the typeface and style of the font like 
text size and specify how the text appears in the UI.
Now Run the application in emulator you will get the output as 
shown below.
                                          

             


Opening an activity in a button click in Android

Opening an Activity in a button click in Android


                                             

In this article you are going to learn about how to open an activity using Explicit intent.

1.Open Eclipse IDE
2.Click File -> New -> Project -> Android Application Project
3.Enter the name of the application  as openactivity and click next 
4.Make sure that you have enabled the create project in workspace
5.Design application launcher icon and create a blank activity workspace and click finish 

Now you need to design your xml file ,xml file is the layout where we design our User Interface.

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="com.mobileapptechnology.openactivity.MainActivity" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_marginTop="150dp"
       android:orientation="vertical" >

        <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/download"
            android:text="" />

    </RelativeLayout>

</RelativeLayout>
In the eclipse the activity_main.xml is present  under the res/layout/activity_main.xml.

In this layout you have to place a button as shown above, i had placed a image  as the background of the button.

After this now you have create a another xml file for the second activity.
so right click on the layout folder and click new and select android xml file ,they layout folder is present under the res folder.name the new xml as secondactivity.xml
String.xml
Normally in Android application whatever the values you are going to give will be provided in a proper manner.
Hardcore values could not be used in the application
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">OpenActivity</string>
    <string name="hello_world">Hello world!</string>
    <string name="action_settings">Settings</string>
    <string name="hai">Hai Friends</string>

</resources>

In  this application we set the value for the text view through the string.xml only as shown above.
the string.xml is under the values folder which is under the res folder.
Secondactivity.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#67C1E6"
    android:orientation="vertical" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="150dp" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:textSize="20sp"
            android:textColor="#FFFFFF"
            android:textStyle="italic"
            android:text="@string/hai" />

    </RelativeLayout>

</RelativeLayout>
In this layout i had placed a textview just to represent a text.in textview i mentioned the style ,size and color for it.and i give the gravity as center to place the text in the center of the screen.

MainActivity.java
Now its time to code the MainActivity as shown below
package com.mobileapptechnology.openactivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Activity {
 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  Button but1=(Button)findViewById(R.id.button1);
  TextView text=(TextView)findViewById(R.id.textView1);
  but1.setOnClickListener(new OnClickListener() {
   
   @Override
   public void onClick(View v) {
    // TODO Auto-generated method stub
    Intent i= new Intent(getApplicationContext(),SecondActivity.class);
    startActivity(i);
   }
  });
 }

 
}
In MainActivity.java i have initialized the textview and button as shown above,after that am creating a on click event for the button to set the action for the button.

Here is used the explicit intent to open an activity from an activity when a button is clicked.

Here the getApplicationContext() refers the current class that 

means it refers the main activity.and the SecondActivity.class file 


refers the SecondActivity.java which is mentioned below.Before 


coding the MainActivity  we have to create a SecondActivity it 

means we have to create a new class by right clicking the package 

under the src folder and click the new and select the class give the 

name as SecondActivity.

SecondActivity.java
package com.mobileapptechnology.openactivity;

import android.app.Activity;
import android.os.Bundle;

public class SecondActivity extends Activity{
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.secondactivity);
}
}


In this SecondActivity we are going to link the secondactivity.xml file with the SecondActivity.java here we just mentioning the layout file .It is highlighted in the above code.

After that you have mention your SecondActivity.java in Manifest file ,Because Each and every activiy which we are newly creating has to be mentioned in Manifest file .Without initializing it the application will be filled with errors.

OpenActivtyManifest.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.mobileapptechnology.openactivity"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="21" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".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="com.mobileapptechnology.openactivity.SecondActivity"></activity>
    </application>

</manifest>
The text which is in bold represent  that the SecondActivity is mentioned in the Manifest File.by default the MainActivity is mentioned in Manifest file.
Now its time to run the application,you will get the output in your emulator as shown below .


When you click the button in the UI it will redirect you the SecondActivity as shown below.
                                                                             


         

Intents

Intent:
            1) Intent is a instant action.

                        2) Intent is a message  that is passed between the components(such as                    activity,content provider,services and content provider).
                          
                        3) Normally intents are used to pass the values between activity and to go from one activity to  another activity.

The main use of intent :

                       1)Start the service 

                       2)Launch the activity

                       3)Display a web page

                       4)Broadcast a message

                       5)Dial a  phone call

Types of Intents:
                 There are two types of intents in android ,they are 
                              
                       1)Implicit Intent

                       2)Explicit Intent



                                                                         

Implicit Intent
                 Implicit intents are used to provide the information of available components provided by the system that to be invoked.

                         For example you can use implicit intent coding  to view a webpage.
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.mobileapptechnology.blogspot.com"));
startActivity(i); 
Explicit Intent 
                 Explicit intents are used to provide the external class,used to move from one activity to other activity.

                        For example you can use the following code  to move from one activity to another activity.
  1. Intent i = new Intent(getApplicationContext(), ActivityTwo.class);  
  2. startActivity(i);  
                          

Tuesday, 26 August 2014

Google Nexus 360 concept is a phone you wouldn’t mind owning

Google Nexus 360 concept is a phone you wouldn’t mind owning

                                               
Nowdays we have seen hundreds of concepts phones and some of them have even made in to production.Now here is a concept phone which will fullfill all your needs in a single device.

                                          
So this Google Nexus 360 concept is a 5-inch smartphone that can bend over backwards to become a smart watch. Great feature, though we are not sure how practiccal it would be to have a 5-inch screen on your wrist.
                                          

Another  Important and intresting feature in this concept phone is the sidepanel which contain the e-ink display for notification the other side houses a bluetooth device which look stylus.


A note from gadget research and review  says they “choose the Google brand for this concept since the search titan has always been at the forefront of innovation, and has the flexibility to partner with a specific hardware manufacturer that can build to its spec”. The obvious effort is to try and find a single solution to all you mobile related problems .



                                                   
Other suggested feature that is available in this concept  phone are Flexible polymer OLED display, integrated fingerprint scanner and heart rate monitor, tube camera for the wrist and IP67-certification for all weather use. 
                                               





Speech To Text In Android

Speech To Text In Android
                                            


1)Lets start a new project in eclipse as we created for earlier projects.

2)Change the layout ,we have to change activity_main.xml appearence by using a image button and a text view as show below.
              
 3)Now you have to code it in java to trigger Speech To Text

4)Open the Main Activity.java  and replace the code as shown below
                                                    

      Here i split the main activity files in to two 
                                                                         

5)Now run and test your Project You will get the Output as shown below.

                                              



Sunday, 25 May 2014

Samsung Developing Smartwatch That Works Without a Smartphone

Samsung Developing Smartwatch That Works Without a Smartphone



  Samsung is working on a Smart watch that doesn't need to sync with smartphone to work .

A report says that south Korean manufacturer is in talk with various telecommunications carriers that would turn the smart watch into phone itself.

User will be able to make call by holding the smart watch to the mouth.

Although most on the market right now need to be tethered to a 

smartphone to receive phone calls, send text messages, check email and use other features, Samsung has its sights set on creating a smart watch that doesn't need a smartphone to work.
 
The Smart watch will  reportedly run on Samsung's tizen Smart watch  operating system.

Samsung's second-generation Gear 2 is lighter,thinner and more powerful- overall it works better than previous model.  

The Samsung smart watch is said to be launch in June or July.     
                                     

Thursday, 22 May 2014

MultiSelection Mode Enabled In ListView By Adding Toggle Button Using Custom Layout In Android

MultiSelection Mode Enabled In ListView By Adding Toggle Button
                                    
                                   

1)Create a new android application project in eclipse 


2))Then after craeting a new project you have to edit the activity_mail.xml file , As shown below.

     
3)Create a layout file for customizing list view items in the file 
                              
                                                         

4) Now you have to code the main activity  file as shown below
                                                                      public class MainActivity extends Activity {
 
    String[] countries = new String[] {
        "India",
        "Pakistan",
        "Sri Lanka",
        "China",
        "Bangladesh",
        "Nepal",
        "Afghanistan",
        "North Korea",
        "South Korea",
        "Japan"
    };
 
    // Array of booleans to store toggle button status
    public boolean[] status = {
        true,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false
    };
 
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
 
        /** Restore from the previous state if exists */
        if(savedInstanceState!=null){
            status = savedInstanceState.getBooleanArray("status");
        }
 
        ListView lvCountries = (ListView) findViewById(R.id.lv_countries);
 
        OnItemClickListener itemClickListener = new OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> lv, View item, int position, long id) {
 
                ListView lView = (ListView) lv;
 
                SimpleAdapter adapter = (SimpleAdapter) lView.getAdapter();
 
                HashMap<String,Object> hm = (HashMap) adapter.getItem(position);
 
                /** The clicked Item in the ListView */
                RelativeLayout rLayout = (RelativeLayout) item;
 
                /** Getting the toggle button corresponding to the clicked item */
                ToggleButton tgl = (ToggleButton) rLayout.getChildAt(1);
 
                String strStatus = "";
                if(tgl.isChecked()){
                    tgl.setChecked(false);
                    strStatus = "Off";
                    status[position]=false;
                }else{
                    tgl.setChecked(true);
                    strStatus = "On";
                    status[position]=true;
                }
                Toast.makeText(getBaseContext(), (String) hm.get("txt") + " : " + strStatus, Toast.LENGTH_SHORT).show();
            }
        };
 
        lvCountries.setOnItemClickListener(itemClickListener);
 
        // Each row in the list stores country name and its status
        List<HashMap<String,Object>> aList = new ArrayList<HashMap<String,Object>>();
 
        for(int i=0;i<10;i++){
            HashMap<String, Object> hm = new HashMap<String,Object>();
            hm.put("txt", countries[i]);
            hm.put("stat",status[i]);
            aList.add(hm);
        }
 
        // Keys used in Hashmap
        String[] from = {"txt","stat" };
 
        // Ids of views in listview_layout
        int[] to = { R.id.tv_item, R.id.tgl_status};
 
        // Instantiating an adapter to store each items
        // R.layout.listview_layout defines the layout of each item
        SimpleAdapter adapter = new SimpleAdapter(getBaseContext(), aList, R.layout.lv_layout, from, to);
 
        lvCountries.setAdapter(adapter);
    }
 
    /** Saving the current state of the activity
    * for configuration changes [ Portrait <=> Landscape ]
    */
    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putBooleanArray("status", status);
    }
 
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}                             

5)Now the listview with toggle button  is ready             
                                                                         

  Download Sourcecode

Total Pageviews

Contact Form

Name

Email *

Message *