Tuesday 12 February 2013

Use an intent filter to open app from weblink



      This is a simple piece of code that helps user to open an application installed in the device by matching the web app website link that is entered to the browser.

      To elaborate the usability.  Once the I enter the link into the browser he is pop upped with an alternate option to open the app installed in device or to navigate tot the application website link



Code is here :



1:        <intent-filter>  
2:          <category android:name="android.intent.category.DEFAULT" />  
3:          <category android:name="android.intent.category.BROWSABLE" />  
4:          <data android:host="trkalimuthu.com" android:scheme="http" />  
5:          <data android:host="www.trkalimuthu.com" android:scheme="https" />  
6:          <action android:name="android.intent.action.VIEW" />  
7:        </intent-filter>  





next pice of code is used webapp to lunch android app.


add this code in android mainfest file :
1:  <intent-filter>  
2:      <action android:name="com.trkalimuthu.android.MY_ACTION" />  
3:      <category android:name="android.intent.category.DEFAULT" />  
4:      <category android:name="android.intent.category.BROWSABLE" />  
5:  </intent-filter>  


following code will apper in webapp :

1:   <a href="intent:#Intent;action=com.trkalimuthu.android.MY_ACTION;end">Lunch App</a>  





the following code is used for lancu the webapp via application 

1:   startActivity(new Intent(Intent.ACTION_VIEW,  
2:                 Uri.parse("http://commonsware.com/sample")));  







Monday 4 February 2013

Android Building Blocks

Android Terminology

        Mobile devices have limited resources to understand application so android they flow some terminological thus app building blocks.           

  • Activity 
  • Content 
  • Indent 
  • Services 
  • Broadcast Receiver

What is an Activities :  

           The Android application each screen called activity. in an application contain more then one activity. 

what is content :

           content is an abstract class . it contains many methods. what subclass need . the
 content contains a top level application details.
            we can get other application files and db dates using  content class .  mostly content contains Activity and Service.
            use the content to share your data to other application.


what is services :

             services is a background process it can't provide any user interaction screen .
             service run an long time process. even the application is switched but service can run.. 


what is an indent : 

            indents are asynchronous messages, running around the inside of the device, notifying applications of various events. communication between the three core components in android activity ,services and broadcast receiver in made possible using indents .         

what is Broadcast Receiver :  

            BroadcastReceiver can be registered to receive system messages and Intents. A BroadcastReceiver will get notified by the Android system, if the specified situation happens. For example a BroadcastReceiver could get called once the Android system completed the boot process or if a phone call is received.