Android

Alternate App Stores / List of Android App Stores

Selling an Android app only on Android Market isn’t enough to reach wider audience. Developers who want to make the android app successful and increase the downloads in short time frame can choose to target alternate Android app stores. Below are almost all the android app stores available. Releasing your app on all these stores may not be good decision, however you can target some of these markets based on, what the store is famous for? or what kind of audience does the app store serve?

Nevertheless, the list of alternate android app stores would definitely help you increase your app sales.

Android Market – https://market.android.com/
Appia – http://www.appia.com/
Mobango – http://in.mobango.com/
SlideMe – http://slideme.org/
Mobiles24 – http://www.mobiles24.com/
AndroidPit – http://www.androidpit.com/
GetJar – http://www.getjar.com/
Handster – http://www.handster.com/
Android Lib – http://www.androlib.com/
AndSpot – http://andspot.com/
NavTech App WareHouse – http://www.nn4d.com/appwarehouse/
AppBrain – http://www.appbrain.com/
AppCity – http://promo.appcity.com/
Cisco AppHQ – https://marketplace.cisco.com/apphq
Apitalism – http://in.appitalism.com/
Appoke – http://appoke.com/
Bloom Worlds – https://bloomworlds.com/
Camangi Market – http://www.camangimarket.com
DJuzz – http://m.djuzz.com
Soc.io Mall – http://soc.io/
YAAM(Yet Another Android Market) – http://yaam.mobi/
AppsLib – http://appslib.com/
AppPlanet – http://www.applanet.net/
Airtel App Central – www.airtel.in/apps
Amazon App Store – http://www.amazon.com/mobile-apps
Pocket Gear – http://www.pocketgear.com/
Docomo Market – http://www.docomo-market.info/
Fast App – http://www.fastapp.com/
Handango – http://www.handango.com
Handmark – http://store.handmark.com/
mJelly – http://mjelly.com/apps/tags/android
Mobihand – http://www.mobihand.com/
Mobile2Day – http://www.mobile2day.com/
Mobile Apps – http://www.mobileapps.com
MobSpot – http://www.mobspot.com/
MPlay it – http://mplayit.com/
Samsung AppStore – http://www.samsungapps.com
Storoid – http://storeoid.com/
White App – http://www.whiteapp.com/

Pricing Strategies for iOS / Android apps

Mobisoft had a top paid app in a revenue-share model with client. App scaled to # 21 in lifestyle category. Naturally, we were excited to know the numbers – downloads, paid/free, adv hits etc. Although we made it great in terms of popularity, the earnings were less than expected.

The main reason was not having effective strategy for pricing model of app’s inApp & subscription purchases. What we realized is that “It could have been great to work on pricing strategy while developing the app” i.e. Monetization of app.

Why Monetize?

  • Generate money

How?

  • Compulsion Loops, there are ways to draw user back into the app
  • Engagement, does it have engagement elements that could be monetized, i.e. virtual currency?
  • Value, is it worth your users’ time?

Models

1. In-app purchases

2. Subscription

3. Ads

4. Location-based offerings

5. Social media sharing and aggregation

To do

1. Try various in-app models to find the combination that maximize your revenues

Games: Subscription based casual gaming package + premium payment for sending best scores

E-books for kids: read once for free. Pay to read again

Security: free trial (e.g. 30 days) . Paid license for 1 year period

• Video: pay per gallery

2. Freemium strategy

  • Strongest marketing play Risk reduction
  • Developers should be focused on finding consumers who are willing to pay, not trying to completely satisfy free-rider consumers

In-App single purchase

Pros:

• This is probably the easiest path to implementation and launch and it’s straightforward and proven

• Virtual goods/currency through In-App

Cons:

• No ongoing revenue stream No access to user data – makes selling advertising difficult.

• One potential workaround is to build in-app surveys, which pushes data back.

Subscription – I

Pros:

  • Revenue is sustainable
  • Renew just as other web based subscriptions
  • Easy extendable as an add-on

Cons:

  • Requires user management solution
  • Requires users to leave the app and visit the publisher’s website to subscribe
  • Conversion rate lower than in-app purchases
  • Success : lifetime value of a subscriber > revenue lost from lower conversion

Subscription – II

Apple’s subscription policy for publishers:

  • Apple still gets a 30% cut of any subscription a reader signs up for inside the App Store.
  • Publishers can now offer an app subscription for a different price than what they might sell their app for in the App Store.
  • Publishers can’t link to an external-to-Apple location that sells a subscription within the app.

Advertising

Apple: iAd platform – Adv as an app

Third party : adMob, Medialets etc

Pros:

  • Easier to command advertising premiums and less pressure to live up to metrics

Cons:

  • Mobile budgets just aren’t well-defined
  • Apple changes strategic decision with third party ad integration

Location Based Offerings

Pros:

  • Awesome mobile offerings into a high-fidelity advertising environment

Cons:

  • Complexity in integrating these systems
  • Requires the device be connected to the internet

Social, Sharing & Aggregation

Pros:

  • Cost-effective
  • Viral marketing
  • Better user engagement

Cons:

Getting advertiser support on a product as nebulous as this is challenging

Other payment integrations

  • Paypal API integrations
  • Carrier billing option – Very easy for users to pay
  • Virtual credits
  • Google Checkout

Other billing platforms

1 MoVend payment platform

  • Easy integration – Supports Android, BlackBerry, Windows Phone7
  • Sales Track Better user engagement

2 Bango

Supports all mobile platforms including Operator billing

Mobisoft Infotech recommend to work with clients as partners and provide various pricing strategies to monetize their app. It will be certainly helpful to clients to get pricing strategies correctly integrated while the app is being developed rather than working on monetization after app is live.

Thank you.

Android OS 2.3 (Gingerbread) is coming with NFC technology

Near field communication (NFC) is one of the latest technologies in mobile phones. This is nothing but a chip with short range high-frequency wireless communication technology that enables quick exchange of data between devices in the vicinity of about 10 cm distance.  So you can virtually transfer data between two successive NFC enabled devices.  NFC can be used for various purposes. Since it is capable of receiving and transmitting data at the same time, it can function as a smart contact-less card and it will definitely bring digital wallet concept in existence in near future.

At the Web 2.0 conference, Google CEO Eric Schmidt said Nexus S is the first android phone coming with android OS 2.3(Gingerbread) with capability of NFC technology. Apple is said to be working on the technology as well to incorporate it to the iPhone 5.

How NFC can be useful for mobile users?

1. NFC can be used for payment at kiosks, ticketing, Internet or person-to-person.
2. Tickets can be purchased, stored, and redeemed.
3. Prepaid card can be stored in smartphones
4. Coupons can be transferred to friends
5. Shopping list can be collected from bags
6. Electronic devices can be activated after purchase and warranties sent in. Or car keys,   house/office keys, hotel room keys can get replaced by NFC enabled smartphones.
7. Secure access to buildings and PCs
8. Inventory control with tags and readers
9. Patient monitoring by keeping medical records on chip
10. Mobile users can touch the NFC enabled devices to exchange the information and contact details.

A person can lose credit card, wallet or personal documents but there are less chances to miss Mobiles and if it happen so, just inform mobile service provider and you can easily stop misuse of your identity, credit card, mobile & all personal information so called “Digital wallets” in one shot. User do not have to call 5 different customer service executive to stop credit card services.

By looking at above facts it looks NFC has promising potential in Mobile Future. Consider you check in at a shopping mall and you get to see the banners or campaign or offers with the your liking based on your behaviors of shopping. So it will be just a matter of booming your mobile devices anywhere(banners, photos, products etc) to get the information or perform transactions. Boom!!!

Using Android NDK to Call Native Code From Android Application

 

The Android NDK is a set of tools that allows Android application developers to embed native machine code compiled from C and/or C++ source files into their application packages.
While you were able to access native code via Java Native Interface (JNI) all along, You would’ve typically had to compile everything on your host computer for the target architecture, requiring you to have the entire toolchain on your development machine.
Android NDK (Native Development Kit) simplifies working with native code. It includes the entire toolchain needed to build for your target platform (ARM). It is designed to help you to create that shared library.

To do’s:

1. Create the Java class that represents the native code
2. Create header file for the native code.
3. Implement the native code by writing your C code
4. Compile everything and build you Shared Library
5. Use your native code inside Android activity
1. Create Native Library

Create a Native Library in src directorary in your Eclipse project.
/src/com.mobisoftinfotech/NativeLib.java

2. Create C Header File

In your project bin directory (in my case, /<workspace>/NDKDemo/bin), run javah tool to create the JNI header file.
NDKDemo/bin$ javah -jni com.mobisoftinfotech.NativeLib
Next, create a jni directory in your project directory ( in my case , <EclipseWorkspace>/NDKDemo/jni).

Next, copy the JNI header from <EclipseWorkspace>/NDKDemo/bin to <EclipseWorkspace>/NDKDemo/jni

3. Write the C Code

In your <EclipseWorkspace>/NDKDemo/jni/ folder, create ndkMathdemo.c file. This is where we’ll implement the native code. To start, copy the function signatures from the header file, and provide the implementation for those functions. In this example, the header file looks like this:

<EclipseWorkspace>/NDKDemo/jni/com_mobisoftinfotech_NativeLib.h

4. Build The Library

To build the library, first we need to create a makefile for how to compile the C code:
<EclipseWorkspace>/NDKDemo/jni/Android.mk

Next, we need to tell NDK how to build the shared library and put it in the correct place inside the Eclipse project. To do this, create a folder <NDKHOME>/apps/ndkMathsdemo/ and inside this folder create the Application file:

<NDKHOME>/apps/ndkMathsdemo/Application

You can now to to your <NDKHOME> and run make APP=ndkMathsdemo

The output should look like this on terminal:-

android-ndk-r4$ make APP=ndkMathsdemo

Android NDK: Building for application ‘ndkMathsdemo’

Compile thumb : ndkMathsdemo <= sources/ndkMathdemo/ndkMathdemo.c

SharedLibrary : libndkMathdemo.so

Install : libndkMathsdemo.so => apps/ndk_demo/project/libs/armeabi

You can now refresh your Eclipse project and you should /lib/ directory containing your libndkMathsdemo.sofile.

5. Calling Native Code from Java

So now that we have the native C library implemented, compiled, and placed in the right place, let’s see how we can call it from our Activity. It’s actually rather simple – you just have to instantiate the instance of your NativeLib class and from there on, it’s just a regular Java object.

Source Code: NDKDemo.tar

Android NDK

Android NDK

The Android NDK is a companion tool to the Android SDK that lets Android application developers build performance-critical portions of their apps in native code. The Android NDK is a toolset that lets you embed components that make use of native code in your Android applications.

Android virtual machine(VM) who can allow your application to source code to call a native code through the JNI(java native interface). This means that our application source code will call shell. And one more thing our application source code declare one more method with the  “native” keyword to indicate that they are implemented through native code.


The NDK provides:

  • A set of tools and build files used to generate native code libraries from C and C++ sources
  • A way to embed the corresponding native libraries into an application package file (.apk) that can be deployed on Android devices
  • A set of native system headers and libraries that will be supported in all future versions of the Android platform, starting from Android 1.5
  • Documentation, samples, and tutorials

The latest release of the NDK supports these ARM instruction sets

  • ARMv5TE
  • ARMv7-A

Contents of the NDK

Development tools

The NDK includes a set of cross-toolchains (compilers, linkers, etc..) that can generate native ARM binaries on Linux, OS X, and Windows (with Cygwin) platforms. It provides a set of system headers for stable native APIs that are guaranteed to be supported in all later releases of the platform:

  • libc (C library) headers
  • libm (math library) headers
  • JNI interface headers
  • libz (Zlib compression) headers
  • liblog (Android logging) header
  • OpenGL ES 1.1 and OpenGL ES 2.0 (3D graphics libraries) headers
  • libjnigraphics (Pixel buffer access) header (for Android 2.2 and above)

Using Android NDK to Call Native Code From Android Application

Call log deletion in Android

In order to delete a call log entry in android device/ Emulator, first of all we must know where the log information is stored. Android stores the log information in its internal database as a content provider – “content://call_log/calls”. 

Call log Basics 

A content provider is used to share data between multiple applications. In Android, a content provider is a specialized type of data store that exposes standardized ways to retrieve and manipulate the stored data. 

The call log data is used by multiple applications and hence android stores it as a content provider. The Call Log provider contains information about placed and received calls. 

To do:

  1. Get uri for call log content provider.
  2. Query the content provider.
  3. Search the row in result set(curser) .
  4. Delete the row from content provider.

URI 

The call log content provider exposes a public URI “content://call_log/calls” for recent phone calls that uniquely identifies its data set. 

Uri allCalls = Uri.parse(“content://call_log/calls”); 

Querying a Content Provider 

To access database we  need to query the content provider by using the uri which the given content provider exposes. 

Cursor c = managedQuery(allCalls, null, null, null, null); 

Reading retrieved data for deleting particular log entry 

Cursor c stores record set of results regarding the log details. So, now in order to delete any record single record, call ContentResolver.delete() with the URI of a specific row. 

To delete multiple rows, call ContentResolver.delete() with the URI of the type of record to delete (for example, android.provider.CallLog.Calls.CONTENT_URI) and an SQL WHERE clause defining which rows to delete. 

Here we will delete the row by comparing ‘NUMBER’ column with the number entered by user. 

while(c.moveToNext()) 

    // get particular number for which log entry is to be deleted. 

    String strNumber= etNumberForCall.getText().toString(); 

    // make a selection clause. 

    String queryString= “NUMBER=’” + strNumber + “‘”; 

    Log.v(“Number”, queryString); 

    CallLogActivity.this.getContentResolver().delete(UriCalls,  queryString, null); 

Screen Shorts: 

  

enterNumber

DeleteScreen

ResultScreen

Following is complete source code: 

package com.mobisoftinfotech; 

import android.app.Activity;

import android.database.Cursor; 

import android.net.Uri;

import android.os.Bundle; 

import android.util.Log;

import android.view.View; 

import android.view.View.OnClickListener;

import android.widget.Button; 

import android.widget.EditText;

import android.widget.Toast; 

/** 

* @author Mohd. Akram 

*/ 

public class CallLogActivity extends Activity {

    /** Called when the activity is first created. */ 

    EditText etNumberForCall; 

    Button btnDeleteNumberFromCallLog; 

@Override 

 public void onCreate(Bundle savedInstanceState) { 

    super.onCreate(savedInstanceState); 

    setContentView(R.layout.main); 

    etNumberForCall=(EditText)findViewById(R.id.EditText01); 

    btnDeleteNumberFromCallLog=(Button)findViewById(R.id.Button01); 

    btnDeleteNumberFromCallLog.setOnClickListener(new OnClickListener() { 

       @Override 

       public void onClick(View v) { 

           // TODO Auto-generated method stub 

          String strUriCalls=”content://call_log/calls”; 

          Uri UriCalls = Uri.parse(strUriCalls); 

          Cursor c = CallLogActivity.this.getContentResolver().query(UriCalls, null, null, null, null); 

          if (c.getCount()<=0) 

              { 

               Toast.makeText(getApplicationContext(), “Call log empty”,Toast.LENGTH_SHORT).show(); 

               etNumberForCall.setText(“”); 

               } 

          while (c.moveToNext()) 

              { 

               String strNumber= etNumberForCall.getText().toString(); 

               String queryString= “NUMBER=’” + strNumber + “‘”; 

                Log.v(“Number”, queryString); 

                int i=CallLogActivity.this.getContentResolver().delete(UriCalls, queryString, null); 

                etNumberForCall.setText(“”); 

                 if(i>=1) 

                     { 

                      Toast.makeText(getApplicationContext(), “Number deleted”, Toast.LENGTH_SHORT).show(); 

                      } 

                  else 

                      { 

                       Toast.makeText(getApplicationContext(), “No such number in call logs”, Toast.LENGTH_SHORT).show(); 

                       } 

                   } 

               } 

           }); 

       } 

 

Android MapView Generate API key Using JAVA Keytool


What is keytool ?


Java Keytool is a key and certificate management utility. It allows users to manage their own public/private key pairs and certificates. It also allows users to cache certificates. Java Keytool stores the keys and certificates in what is called a keystore. By default the Java keystore is implemented as a file. It protects private keys with a password. A Keytool keystore contains the private key and any certificates necessary to complete a chain of trust and establish the trustworthiness of the primary certificate.
Each certificate in a Java keystore is associated with a unique alias. When creating a Java keystore you will first create the .jks file that will initially only contain the private key. You will then generate a CSR and have a certificate generated from it. Then you will import the certificate to the keystore including any root certificates. Java Keytool also several other functions that allow you to view the details of a certificate or list the certificates contained in a keystore or export a certificate.
Note: For easier management of your Java Keystores (using a GUI) check out Portecle. If you need to buy a certificate, try to compare SSL with our SSL Wizard.


Steps to be followed


1) Go to Command prompt
2) Generate MD5 Key using java keytool.
3) Fill the information for the key.
4) Get the md5 key.
5) Register it with google.
6) Get the API Key from The google.
7) Use the API key in your application


Description

1) In windows start command promt :
press “ Widow key + r” run diaolg will apear
type cmd and press enter
OR
Press widows key then in search bar type cmd select command prompt from the list.
Then change directory to jdk/bin
e.g c:/…./java/jdk.16/bin

2) Enter the following command…
keytool –genkeypair -alias (alias_name) -keypass (password)
e.g. keytool -genkeypair -alias andy -keypass android

3) Fill the information form.

After running the above command you will find .keystore file generated at your home folder
C:\Users\…\.keystore

4) Run the following command to get Certificate fingerprint (MD5):
keytool -list -alias -keystore .keystore
e.g. keytool -list -alias andy -keystore c:\Users\..\.keystore

5) After getting the key, register the key with google, on the following link

http://code.google.com/android/maps-api-signup.html

6) Follow the steps and you will get the API key.

7) Use that key in your android/iPhone application.

For detailed use of key tool go to following link

http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/keytool.html

Android Jtwitter : Twitter Connect Tutorial



Now a days social networking websites like Twitter&  are becoming very popular,
so integrating Twitter with app has become a necessity to make your application popular.
We are going to do the same through this tutorial. The Twitter Connect SDK provides
code which third-party developers can embed into their applications to connect to their
Twitter accounts and exchange information with Android apps. It’s a way of embedding
“social context” to an Android app, according to Twitter.

Create a Viewbased Application with name ‘Twitter Android Prj’.

Follow the following steps:

1)    Download jtwitter.jar for Android
http://www.winterwell.com/software/jtwitter.php

  • 1.1 First you have to set up new Android project .
  • 1.2 We have to add all JARs and Library files.
  • 1.3 Import all files in the destination group folder.
  • 1.4 To test import all JAR and library in case any miss.And compile.
  • 2) Create your twitter Acoount.
    3)  Now Save project (Command +S). Build and Run Project.
    4) enter user name and password & Click on Log In Button.
    5) Initailly you will see the friends List.
    6) Click on Twit button and you can post new tweets in input dialog click ok to post .
    7) Click on Followers button and you eill see the list of followers.
    8 ) Click on Favorites button and you eill see the list of favorite tweets.

    Description :

    1)  Download jtwitter.jar
    1.1  We have to add all JARs and Library files as below

    add_jar1

    add_jar2

    1.2 Import all files destination group folder. It should also look as shown below

    ImportedLib

    Append Following code in .xml file for UI Design

    [/xml]

    <;?xml version="1.0" encoding="utf-8"?>

    <ImageView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:src="@drawable/logo1"
    android:layout_gravity="center_horizontal"
    android:layout_marginLeft="0dip"
    android:layout_marginTop="20dip"
    />

    <!– Code For Login Name And Password  –>
    <FrameLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="#fff"
    android:layout_marginTop="70dip">
    <TableLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical"
    android:gravity="center_horizontal"  >
    <TableRow
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="User Name"
    android:layout_marginLeft="40dip"
    android:textColor="#000"
    />
    <EditText
    android:layout_width="150dip"
    android:layout_height="wrap_content"
    android:layout_marginLeft="40dip"
    android:singleLine="true"
    android:id="@+id/main_username_edit_text"
    />
    </TableRow>

    <TableRow
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Password"
    android:layout_marginLeft="40dip"
    android:textColor="#000"
    />
    <EditText
    android:layout_width="150dip"
    android:layout_height="wrap_content"
    android:layout_marginLeft="40dip"
    android:password="true"
    android:singleLine="true"
    android:id="@+id/main_password_edit_text"
    />
    </TableRow>

    </TableLayout>
    </FrameLayout>
    <Button
    android:layout_width="70dip"
    android:layout_height="wrap_content"
    android:text="Log In"
    android:id="@+id/main_loin_button"
    android:layout_marginTop="20dip"
    android:layout_marginLeft="130dip"
    />
    <!– Code For Login Name And Password Ends –>
    </LinearLayout>
    [/java]

    Code Description :
    Login:

    my_twiter = new Twitter(userName,password);
    if(my_twiter == null){
    Toast.makeText(main.this, "Incorrect Login",
    Toast.LENGTH_LONG).show();
    }
    else {
    try {
    Log.v("Twitter Status :",my_twiter.getStatus()+"");
    Intent intent = new Intent(main.this,Twitter_Info_Activity.class);
    startActivity(intent);
    }catch(Exception e){
    e.printStackTrace();
    }
    }
    

    Tweet Button Click :

    setTitle("Tweet");
    AlertDialog.Builder inputDialog;
    inputDialog = new AlertDialog.Builder(Twitter_Info_Activity.this);
    inputDialog.setTitle("Enter Tweet");
    et_input = new EditText(Twitter_Info_Activity.this);
    et_input.setWidth(250);
    et_input.setHeight(30);
    inputDialog.setView(et_input);
    inputDialog.setPositiveButton("Ok",
    new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
    // TODO Auto-generated method stub
    String txt_tweet= et_input.getText().toString();
    main.my_twiter.setStatus(txt_tweet);
    Toast.makeText(Twitter_Info_Activity.this,
    "Tweet Successful",
    Toast.LENGTH_LONG).show();
    }
    });
    inputDialog.setNegativeButton("Cancle",
    new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
    // TODO Auto-generated method stub
    }
    });
    inputDialog.show();
    }
    

    Friends Button Click :

    setTitle("Friends");
    List<User> arr= main.my_twiter.getFriends();
    Object[] str=arr.toArray();
    String[] str1 = new String[str.length];
    for(int i=0;i<str.length;i++) {
    str1[i] = str[i].toString();
    }
    lst_myTwitts.setAdapter(new ArrayAdapter<String>(Twitter_Info_Activity.this,
    android.R.layout.simple_list_item_1, str1));
    

    Followers Button Click :

    setTitle("Followers");
    List<User> arr= main.my_twiter.getFollowers();
    Object[] str=arr.toArray();
    String[] str1 = new String[str.length];
    if(str1.length == 0) {
    Toast.makeText(Twitter_Info_Activity.this, "No Followers",
    Toast.LENGTH_LONG).show();
    }
    for(int i=0;i<str.length;i++) {
    str1[i] = str[i].toString();
    }
    lst_myTwitts.setAdapter(new ArrayAdapter<String>
    (Twitter_Info_Activity.this,
    android.R.layout.simple_list_item_1, str1));
    

    Favorite Button Click :

    setTitle("Favorites");
    List<Status> arr= main.my_twiter.getFavorites();
    Object[] str=arr.toArray();
    String[] str1 = new String[str.length];
    if(str1.length == 0) {
    Toast.makeText(Twitter_Info_Activity.this,
    "No Favorites", Toast.LENGTH_LONG).show();
    }
    for(int i=0;i<str.length;i++) {
    str1[i] = str[i].toString();
    }
    lst_myTwitts.setAdapter(new ArrayAdapter<String>(Twitter_Info_Activity.this,
    android.R.layout.simple_list_item_1, str1));
    

    Now Save project (Command +S). Build and Run Project.

    Simulator will look like as follows

    1) Login Screen : enter your twitter user name and password

    LoginScreen

    2) Friends Screen : shows your friends list.

    FriendsList

    3) Tweet : Click on Tweet Button

    TweetClick

    Input Dialog will appear

    TweetDialog

    Enter The Text in the dialogBox and click on Ok.

    TweetMessage

    it will show the message the tweet is successful.

    SuccessfulTweet

    The message will look something like this

    TwitterUpdate

    4)Followers Screen : shows the list of followers.

    FollowersList

    5) Favorite Screen : shows the fovorite tweets.

    FavoriteList

    How to install .apk / non-market application file on Android Phones

    As android is open source technology and there is to restriction on the developer to distribute their apps. So one can download the app from the net and install it devise to use or test.

    If

    You have installed android SDK on your PC then there is ADB tool in tools directory of the sdk setup. That will help you to install the app on device/emulator.

    Else

    Follow the

    TODOs

    1. On your android device open the Market application. logo similar as below.
    2. Search for “apk installer” in Market application.
    3. You will find many applications to related to key word apk installer and those also free. Choose any one to install on your phone.
    4. Connect phone to PC through the USB and mount the SD Card from notification.
    5. Copy the apk file on your phones SD card.
    6. Open the app you installed in above steps.
    7. Application will find and show list of  the apks on your SD card.
    8. Choose the apk file name from list which you want to install.
    9. ‘APK installer ’ will install it for you.
    10. Enjoy the app.

    Android FBConnect: Facebook Connect Tutorial

    Now a days social networking websites like facebook are becoming very popular, so integrating facebook with app has become a necessity to make your application popular. We are going to do the same through this tutorial. The Facebook Connect SDK provides code which third-party developers can embed into their applications to connect to their Facebook accounts and exchange information with Android apps. It’s a way of embedding “social context” to an Android app, according to Facebook.

    Create a Viewbased Application with name ‘fbconnect-samples’.

    Follow the following steps:

    1) Download Facebook Connect for Android

    • 1.1 First you have to set up new java project with fbconnect itself.
    • 1.2 We have to add all JARs and Library files as below.
    • 1.3 Import all files in the destination group folder.
    • 1.4 To test import all JAR and library in case any miss.And compile.

    2) Login to Facebook.

    After that go to Developers Page (http://www.facebook.com/developers/) as shown below.

    3) Register your application with Facebook

    • 3.1 Click on Set up New Application Button in the upper right hand corner.
    • 3.2 Give Application name and click on create application button. Then you will see new application screen with detail including “API key”and “API Secret Key”

    4) Now Save project (Command +S). Build and Run Project.

    5) Click on Fconnect Button and Facebook Login Dialog will appear.

    6) Login with your user name and Password. Click on publish To Feed.

    7) Wait for untill post to Wall Dialog pops up.

    8) The Msg on Facebook will something look like this.

    Description

    1) Download Facebook Connect for Android

    http://code.google.com.iproxy.saverpigeeks.com/p/fbconnect-android/downloads/list
    Just go through the project. In particular, the “Connect” sample project. Sample Project gives demo of some of the functionality.
    1.1 First you have to set up new java project with fbconnect itself.
    - Unzip “fbconnect-android.zip/api” into your workspace and then
    Import Project to Eclipse.
    -add External library “android.jar” into project’s build
    path. I used android.jar from Android 1.6.

    -After it compiles – from eclipse’s menu choose File->Export->Java-
    >Jar file

    - select fbconnect project’s “src” directory as resource to export.

    - type in path and name of exported .jar (fbconnect.jar)

    - go to your project’s preferences and add fbconnect.jar into your
    libraries (in Java Build Path)

    1.2 We have to add all JARs and Library files as below.

    fbconnectjarfile

    1.3 Import all files destination group folder. It should also look as shown below.

    fbconnectimplementation

    1.4.To test import all JAR and library in case any miss and compile.

    2) Login to Facebook.

    After that go to Developers Page (http://www.facebook.com/developers/) as shown below.

    facebookdeveloperslogin

    3) Register your application with Facebook.

    facebooksetapplication

    3.1.Click on Set up New Application Button in the upper right hand corner.

    3.2. Give Application name and click on create application button. Then you will see new application screen with detail including “API key”and “API Secret Key”

    facebookapikey

    Note : This application will not work until you provide your Facebook application’s API keys.
    Now to get started with actual coding:

    Append Following code in .xml file for UI Design

    
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    	android:orientation="vertical" android:layout_width="fill_parent"
    	android:layout_height="fill_parent" android:background="@drawable/cyan"
    	android:gravity="center_horizontal">
    
    	<com.codecarpet.fbconnect.FBLoginButton
    		android:id="@+id/login"
    		android:layout_width="wrap_content"
    		android:layout_height="wrap_content"
    		android:layout_margin="30dp"
    		/>
    
    	<TextView android:id="@+id/label"
    		android:textColor="@drawable/black"
    		android:layout_width="wrap_content"
    		android:layout_height="wrap_content"
    		android:layout_margin="30dp"
    		/>
    
    	<Button android:id="@+id/permissionButton"
    		android:layout_width="wrap_content"
    		android:layout_height="wrap_content"
    		android:text="@string/get_permission"
    		android:visibility="invisible"
    		android:paddingRight="30dp"
    		android:paddingLeft="30dp"
    		android:layout_margin="30dp"
    		/>
    
    	<Button android:id="@+id/feedButton"
    		android:layout_width="wrap_content"
    		android:layout_height="wrap_content"
    		android:text="@string/publish_to_feed"
    		android:visibility="invisible"
    		android:paddingRight="30dp"
    		android:paddingLeft="30dp"
    		android:layout_margin="30dp"
    		/>
    
    </LinearLayout>
    
    private static final String API_KEY = ""; // "<YOUR API KEY>";
    
    	// Enter either your API secret or a callback URL (as described in documentation):
        private static final String API_SECRET = ""; // "<YOUR SECRET KEY>";
        private static final String GET_SESSION_PROXY = null;
    
    private FBSession mSession;
    
    if (GET_SESSION_PROXY != null) {
                mSession = FBSession.getSessionForApplication_getSessionProxy(API_KEY,
            GET_SESSION_PROXY, new FBSessionDelegateImpl());
            } else {
                mSession = FBSession.getSessionForApplication_secret(API_KEY,
             API_SECRET, new FBSessionDelegateImpl());
            }
    

    Here in fbconnect-samplesAppDelegate we have just declared mSession reference variable of type FBSession to keep track of the session and to check if session for current user exists or not.

    private void askPermission() {
            Intent intent = new Intent(this, FBPermissionActivity.class);
            intent.putExtra("permissions", new String[]{"publish_stream"});
            this.startActivityForResult(intent, PERMISSION_REQUESTCODE );
        }
    
        @Override
        protected void onActivityResult(int requestCode, int resultCode, Intent data) {
            super.onActivityResult(requestCode, resultCode, data);
    
            switch (requestCode){
            case PERMISSION_REQUESTCODE:
                if (resultCode == 1)
                {
            		mPermissionButton.setVisibility(View.INVISIBLE);
            		mFeedDirectButton.setVisibility(View.VISIBLE);
                }
            default:
                return;
            }
    
        }
    
        private void publishFeed() {
        	Map<String, String> params = new HashMap<String, String>();
        	params.put("attachment", "{\"name\":\"Facebook Connect for Android\",
                            \"href\":\"http://code.google.com/p/fbconnect-android/\",
                             \"caption\":\"Caption\",\"description\":\"Description\",
                               \"media\":[{\"type\":\"image\",\"src\":\"http:/
                             /img40.yfrog.com/img40/5914/iphoneconnectbtn.jpg\",
                             \"href\":\"http://developers.facebook.com/
                               connect.php?tab=iphone/\"}],
                                 \"properties\":{\"another link\":{\"text\":
                              \"Facebook home page\",\"href\":
                                \ "http://www.facebook.com\"
    }
    }
    }");
    
        	// publish_stream extended permission is required to call Stream.publish
        	FBRequest.request().call("Stream.publish", params);
        }
    
        private void publishFeedWithPrompt() {
        	Intent intent = new Intent(this, FBFeedActivity.class);
            intent.putExtra("userMessagePrompt", "Example prompt");
            intent.putExtra("attachment", "{\"name\":\"Facebook Connect for Android\",
                                \"href\":\"http://code.google.com/p/fbconnect-android/\",
                                 \"caption\": \"Caption\",\"description\":\"Description\",
                                  \"media\":[{\"type\":\"image\",\"src\":
                                   \"http://img40.yfrog.com
                                    /img40/5914/iphoneconnectbtn.jpg\",
                                   \"href\":\"http://developers.facebook.com
                                   /connect.php?tab=iphone/\"}],\"properties\":
                                {\"another link\":{\"text\":\"Facebook home page\",
                                      \"href\":\"http://www.facebook.com\"
    }
    }
    }");
            this.startActivityForResult(intent, MESSAGE_PUBLISHED);
        }
    

    Define API key and Secret key with the keys you received while registering your app on facebook.
    1. private static final String kApiKey = “7e835e394c0c8283fab2929108d6218f”;
    2. private static final String kApiSecret = “eff16d8c6a2c6a9440d9ed63598ad501″;

    Validate session variable in requestDidLoad. If it doesn’t exist then create the same for using API key and Secret key. For that, one needs to conform the protocol FBSessionDelegate in respective file. Also create a login button using FBLoginButton.

    private class FBRequestDelegateImpl extends FBRequestDelegate {
    
            @Override
            public void requestDidLoad(FBRequest request, Object result) {
    
                String name = null;
    
                if (result instanceof JSONArray) {
                    JSONArray jsonArray = (JSONArray) result;
                    try {
                        JSONObject jo = jsonArray.getJSONObject(0);
                        name = jo.getString("name");
                    } catch (JSONException e) {
                        Log.e(LOG, "Login response error", e);
                    }
                }
                mLabel.setText("Logged in as " + name);
            }
    
            @Override
            public void requestDidFailWithError(FBRequest request, Throwable error) {
                mLabel.setText(error.toString());
            }
        }
    
      private class FBHasPermissionRD extends FBRequestDelegate {
    
            @Override
            public void requestDidFailWithError(FBRequest request, Throwable error) {
                super.requestDidFailWithError(request, error);
            }
    
            @Override
            public void requestDidLoad(FBRequest request, Object result) {
                int hasPermission = 0;
    
                if (result instanceof JSONArray) {
                    JSONArray jsonArray = (JSONArray) result;
                    try {
                        JSONObject jo = jsonArray.getJSONObject(0);
                        hasPermission = jo.getInt("publish_stream");
                        if (hasPermission == 0) {
                            mHandler.post(new Runnable() {
                                public void run() {
                                    mPermissionButton.setVisibility(View.VISIBLE);
                                }
                            });
                        }
                        else
                        	mFeedDirectButton.setVisibility(View.VISIBLE);
                    } catch (JSONException e) {
                        Log.e(LOG, "Permission response error", e);
                    }
                }
            }
    

    This methos is automatically called when user is logged in using FBConnect SDK.
    In this method we get session for that user and it’s uid which unique identifier for that user.
    Once FBSession session is avaiable, we can accesss all the APIs provided by Facebook.
    For now, we will see how to post user name and status on the facebook wall.
    To get Facebook username a request is send in which select query is written to get username using uid

    private class FBDialogDelegateImpl extends FBDialogDelegate {
            @Override
            public void dialogDidFailWithError(FBDialog dialog, Throwable error) {
                mLabel.setText(error.toString());
            }
        }
    
        private void checkPermission() {
            String fql = "select publish_stream from permissions where uid == "
    + String.valueOf(mSession.getUid());
            Map<String, String> params = Collections
                          .singletonMap("query", fql);
          FBRequest.requestWithDelegate
             (new FBHasPermissionRD()).call("facebook.fql.query", params);
        }
    

    Use publishFeed method to post message on the facbook wall. A dialog pops up with a message box to post on Wall.

        private void publishFeed() {
    
    Map<String, String> params = new HashMap<String, String>();
        	params.put("attachment", "{\"name\":\"Facebook Connect for Android
    
        	// publish_stream extended permission is required to call Stream.publish
        	FBRequest.request().call("Stream.publish", params);
        }
    

    Use sessionDidLogout method for logout from session.

    public void sessionDidLogout(FBSession session) {
                mHandler.post(new Runnable() {
                    public void run() {
                        mLabel.setText("");
                        mPermissionButton.setVisibility(View.INVISIBLE);
                        mFeedButton.setVisibility(View.INVISIBLE);
                    }
                });
            }
    
        }
    

    4) Now Save project (Command +S). Build and Run Project.

    Simulator will look like as follows

    facebookconnect

    5) Click on Fconnect Button and Facebook Login Dialog will appear.

    facebooklogin

    6) Login with your user name and Password.

    Click on publish To Feed

    facebookloggedin

    7) Wait for untill post to Wall Dialog pops up.

    facebookfeed

    8) The Msg on Facebook will something look like this.

    facebookmessage