Showing posts with label ACRA (Application Crash Report for Android). Show all posts
Showing posts with label ACRA (Application Crash Report for Android). Show all posts

Friday, March 2, 2012

Mobile Advertising Frameworks for Android ,iOS,Windows,RIM devices

As a developer,when you are developing a free application, it is good idea to integrate advertising frameworks on the applications to generate revenue for the developer.

Then we need to consider some factors before integrating the framework into application.
The factors are as mentioned below.

The success of this new advertising channel depends on the customer acceptance of advertising.
(1) entertainment is the most important attribute affecting consumer attitudes toward mobile advertising,
(2) in our society, consumers have not generally negative attitudes toward mobile advertising but they prefer prior permission
(3) incentives that offer free minutes on the phone lead to more positive influence on consumer intentions to receive and read mobile advertisements.

There were some advt frameworks available.

LeadBolt :  


Logo
LeadBolt makes it easy for mobile app developers to quickly earn superior industry eCPM's and EPC's on their traffic. LeadBolt's ads are fully customizable and allow for unique implementation opportunities to optimize your earning capabilities within your app. LeadBolt works with thousands of mobile advertisers to fill your ad inventory with top-tier offers.

Ad Types

  • Content Unlockers + Push Notifications
  • Splash Screens + Banner Ads
  • Text Only Unlockers + Image Banner Ads

Why Use LeadBolt’s CPC Advertising Platform?

  • Reach Millions of Loyal Android & Apple iOS Users.
  • Fast Campaign Setup – Intuitive & Easy To Use Platform.
  • High Performance CPC Campaigns – Only Pay for Actual Clicks, No Money Wasted On CPM.
  • No Setup Fees, No Service Fees, No Charge for Displaying Your Ads.
  • You Are 100% In Control Of Your Campaign – Edit Or Pause Anytime.
  • Hassle-Free Funding.
  • Instant Campaign Approval.
  • Minimum Deposit Only $50.
  • Real-Time Stats – See Immediate Traffic Results.
SUMMARY

Started operating
2010
Minimum payout
$100
Payment method
paypal,bank wire
Payment frequency
Net-15
Number of programs
100+
Offer types
lead,free trial,incentive
Referral/2 tier commission:
upto 10%
Affiliate tracking software
Inhouse  tracking software
Affiliate tools
 content unloack gateway,banner gateway,download gateway
Realtime statistics
yes
Countries accepted
All
Joining Fee
 Free

Airpush   

Airpush, the leading app monetization solution for Android developers.AirPush utilizes push notification ad units - ads that serve after the user has exited the app. These tend to generate a higher eCPM because they mirror the standard notifications a mobile device receives and fall outside traditional/expected ad placement.

However, as with any advertising strategy, you have to control the frequency of the notifications. These type of ad units get a bad rep because publishers get trigger-happy and want to prompt them constantly, which often results in uninstalls and negative marketplace reviews.


If you're smart about the notification serving and target it properly, it can be a lucrative monetization method - an average $10+ eCPM on our network. We also let you control the recurrence of the ads so as not to impede the user experience yet keeping it optimized.

Airpush different from Admob and other traditional mobile ad networks ?
  • Earn 10x - 30x More !
Over 40,000 Android developers use our next-generation ad formats to increase revenue 10 - 30x versus traditional in-app ad networks.  Our developers earn $10 - $50 CPM's with our innovative ad formats: Push Notification Ads, Icon Ads, and Signup Ads.

  • Get Paid Weekly !
Airpush is the only mobile ad network which pays developers on a weekly basis. Stop waiting weeks or months for your ad network payments, and start experiencing the cash flow improvement from weekly payments.
  • 100% Android-focused !
Airpush is the only mobile ad network focused exclusively on Android™ . Our team is dedicated to improving Android developer earnings via next-generation ad technologies. 
Integration: Developers add the Airpush client SDK in their Android™ app, which consists of an ultra-lightweight JAR file like most mobile ad networks. When executed once from the main activity of an Android™ application, the Airpush client utilizes Android™ OS's AlarmManager framework to schedule ongoing server polling events a few times per day. If an ad is polled from the server it is cached until optimal display time, which is algorithmically determined by the server.

For More refer to: http://www.airpush.com/faq#how-does-the-airpush-client-sdk-work

Google AdMob: 


AdMob is one of the world's largest mobile advertising networks, offering solutions for discovery, branding and monetization on the mobile web.


The SDK features:
  • streamlined APIs
  • instant access to the latest HTML5 ad units
  • Android tablet formats
  • support for iOS 4.3 and Windows Phone 7
Using the SDK, Android, iOS, and Windows Phone 7 developers can easily incorporate Google AdMob Ads into their mobile apps. Mobile-friendly text and image banners are available along with rich, full-screen web apps known as interstitials. An ever-growing set of "calls-to-action" are supported in response to user touch including direct access to the App Store, Android Market and Windows Phone 7 Marketplace, iTunes, maps, video and the dialer. Ads can be targeted by location and demographic data.

Join thousands of app developers worldwide to grow your mobile app business with AdMob by Google.
  • Earn revenue across platforms with AdMob's mobile-specific formats and the reach of Google's advertiser network.
  • Promote your apps with a paid ad campaign on the AdMob network or for free on your own properties with AdMob House Ads.
  • Measure performance with real-time reporting that helps you evaluate performance across ad placements, OS platforms and geography.
Developer reference: http://www.google.com/ads/mobile/publishers/app-developers.html
  
Developer Benefits

New ad formats
Support for banners, interstitials, and tablet-specific formats for Android and iOS.
Advanced creatives
Creatives represent rich, immersive HTML5 user experiences, and may implement a variety of calls-to-action.
Targeted ads from AdMob's large advertiser network
Your app's ads can be targeted by demographics and location.
Easy integration
Quickly implement Google advertising directly in your app.
 
 For more information,refer to https://developers.google.com/mobile-ads-sdk/docs/rel-notes#android

Please share if you are experience with any other advt frameworks for any smartphone platforms.

TapIt!™

TapIt!™ does the heavy lifting to make technology, techEasy. Our seamless SDK integration makes it quick and easy to start generating faster clicks and faster revenue. Our internal optimization team organizes and formats our array of ads which include fixed banners, expandables, video ads, full page interstitials, and interactive rich media to utilize every new feature of mobile devices. Tapping an ad has turned into tapping into a new digital world, and we target all types of users involved so that you can see all your traffic become revenue.


supports iPhone, Android, Blackberry, Windows.


Reasons: 
1. We are the only Brand Performance Demand Side Platform.
2. Over 90% Fill Rate
3. 24/7 Real Time Reporting
4. Seamless SDK Integration
5. Quality Brands with Quality Partners

More Read here.

Payment:TapIt!™ pays publishers after the end of each calendar month. All payments are made on a net 45 terms, and payment can be made via PayPal, Pay Divvy, Check, ACH, or Wire Transfer.  Please make note that we require some sort of identification for tax purposes.

You can download our Android SDK, iOS SDK and access Help Files HERE, or you contact our support team at 888-444-1494 option 4 or email us at Support: support@tapit.com for more assistance. We look forward to serving you!

Click here to Get Started,  You may also read more about our Fill Rates, eCPM’s, Service Levels and SDK’s here.


Saturday, February 25, 2012

MediaPlayer: Playing Video and Audio files

With every activity, after onPause and onStop, if the activity is not destroyed, it will continue to run in the background, until it is killed so the system can free up the memory it is using. So until the activity is destroyed, the mediaplayer will continue to occupy space in the phones memory.

When done with the MediaPlayer, you should call release(), to free the resources. If not released, too many MediaPlayer instances will result in an exception." 
 Depending on your needs, you can put the mp.stop() in the onPause part, so if the activity goes to the background for whatever reason, it will only pause the playback, and it can continue it in onResume(). Just put mp.play() in onResume().
If you don't release the media player in the onDestroy part, it will continue to be in the memory, after the activity is stopped. The OS will handle this issue for you if it runs out of memory, but it's nicer, if You do it, so the OS will run out of memory later (much later in case of huge files).
private MediaPlayer mp;
 
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mp=new MediaPlayer();
    startAudioPlayer(context,uri);
//you could set up an onCompletionListener, so when the media playback is done, it will release the media player.
mp.setOnCompletionListener(new OnCompletionListener(){
    @Override
    public void onCompletion(MediaPlayer mp) {
        mp.release();
    }
 });

}
 
public void startAudioPlayer(Context context,Uri uri){
    mp= MediaPlayer.create(context, uri);
    mp.start();
}
 
@Override
protected void onPause() {
    super.onPause();
    if(mp.isPlaying()){ //you need to check if it is playing first, or you might get a null pointer exception!
        mp.stop();
    }
}
@Override
 public void onDestroy(){
 super.onDestroy();
    mp.release();
 }
   
Another way to play an audio file.
 
public void audioPlayer(String path, String fileName){

    //set up MediaPlayer    

    MediaPlayer mp = new MediaPlayer();



    try {

        mp.setDataSource(path+"/"+fileName);

    } catch (IllegalArgumentException e) {

        // TODO Auto-generated catch block

        e.printStackTrace();

    } catch (IllegalStateException e) {

        // TODO Auto-generated catch block

        e.printStackTrace();

    } catch (IOException e) {

        // TODO Auto-generated catch block

        e.printStackTrace();

    }


    try {

        mp.prepare();

    } catch (IllegalStateException e) {

        // TODO Auto-generated catch block

        e.printStackTrace();

    } catch (IOException e) {

        // TODO Auto-generated catch block

        e.printStackTrace();

    }

    mp.start();

} 

Incase of Video File, use this method to play the video file

public void videoPlayer(String path, String fileName, boolean autoplay){
//get current window information, 
    //and set format, set it up differently, 
    //if you need some special effects
getWindow().setFormat(PixelFormat.TRANSLUCENT);
//the VideoView will hold the video
VideoView videoHolder = new VideoView(this);
//MediaController is the ui control howering above the video (just like in the default youtube player).
videoHolder.setMediaController(new MediaController(this));
//assing a video file to the video holder
videoHolder.setVideoURI(Uri.parse(path+"/"+fileName));
//get focus, before playing the video.
videoHolder.requestFocus();
if(autoplay){
videoHolder.start();
    }
}

Tuesday, February 21, 2012

Crash Reporting Feature to any ANDROID application

AIM: To enable crash Reporting feature to android app

Solution: 

A crash reporter is an feature whose function is to report crash data to a third party, usually to the party responsible for the crashed program. Crash reports often include data such as stack traces, type of crash, and version of software. This information helps software developers to diagnose and fix the underlying problem causing the crash.

The Android and iOS operating systems also have built in crash reporting functionality.
There are third party tools that also provide it, like

BugSense :
BugSense is made for mobile developers. Get the context of the errors, track errors in specific app version or filter errors by device. There was Internet connectivity at the time of the crash? BugSense collects all the information the mobile developer needs. 

ACRA (Application Crash Report for Android).

ACRA is a library enabling Android Application to automatically post their crash reports to a GoogleDoc form. It is targetted to android applications developers to help them get data from their applications when they crash or behave erroneously.  

However you can add this feature with the following code block.

---------------------------------------------------------------------------------
/**
 * Crash Error Reporter
 *
 * Captures any Uncaught exception to capture the conditions that caused the event.
 * The event will be written to the Log file and can be retrieved through LogCat.
 * In addition, the report will attempt to send an e-mail to <string name="CrashErrorReport_MailTo">xyz@GMail.com</string>
 * through the default mail application
 *  *
 */


public class CrashErrorReporter implements Thread.UncaughtExceptionHandler {
   
    private static final String LOG_TAG = "CrashErrorReporter";

    private Thread.UncaughtExceptionHandler mDfltExceptionHandler;
    private static CrashErrorReporter S_mInstance;
    private static Context mCurContext;

    // Even though these should be private variables,
    // they are public to avoid creating getters and setters
    String mPkg_VersionName;
    String mPkg_PackageName;
    String mCtx_FilePath;
   
    String mPkg_OSBld_PhoneModel;
    String mPkg_OSBld_AndroidVersion;
    String mPkg_OSBld_Board;
    String mPkg_OSBld_Brand;
    String mPkg_OSBld_Device;
    String mPkg_OSBld_Display;
    String mPkg_OSBld_FingerPrint;
    String mPkg_OSBld_Host;
    String mPkg_OSBld_ID;
    String mPkg_OSBld_Manufacturer;
    String mPkg_OSBld_Model;
    String mPkg_OSBld_Product;
    String mPkg_OSBld_Tags;
    long   mPkg_OSBld_Time;
    String mPkg_OSBld_Type;
    String mPkg_OSBld_User;

    /**
     * Manages the uncaught exception.
     */
    @Override
    public void uncaughtException(Thread t, Throwable e) {
        Log.d(LOG_TAG, "@Override uncaughtException");

        Date CurDate = new Date();

        String Report = "Error Report collected on : " + CurDate.toString() + "\n\n";
        Report += "Environment Details : \n";
        Report += "===================== \n";
        Report += CreateInformationString();
       
        Report += "Stack : \n";
        Report += "======= \n";
        final Writer result = new StringWriter();
        final PrintWriter printWriter = new PrintWriter(result);
        e.printStackTrace(printWriter);
        String stacktrace = result.toString();
        Report += stacktrace  + "\n";

        // If the exception was thrown in a background thread inside
        // AsyncTask, then the actual exception can be found with getCause
        Throwable cause = e.getCause();
        while (cause != null) {
            Report += "Cause : \n";
            Report += "======= \n";
            cause.printStackTrace( printWriter );
            Report += result.toString();
            cause = cause.getCause();
        }
        printWriter.close();
        Report += "**** End of current Report ***";
        SaveAsFile(Report);
       
        // Try and send out the report now before calling the default handler
        CheckCrashErrorAndSendMail(mCurContext);
        mDfltExceptionHandler.uncaughtException(t, e);
    }
   
    /**
     * Capture the newly created instance for singleton class management
     */
    public static CrashErrorReporter getInstance() {
        if ( S_mInstance == null )
            S_mInstance = new CrashErrorReporter();
        return S_mInstance;
    }

    public void Init( Context context ) {
        mDfltExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
        Thread.setDefaultUncaughtExceptionHandler( this );
        mCurContext = context;
    }
   
    /**
     * Obtains the available internal memory size
     * @return long  - integer with memory size available
     */
    public long getAvailableInternalMemorySize() {
        File   path = Environment.getDataDirectory();
        StatFs stat = new StatFs(path.getPath());
       
        // place in stack variables for debugging purposes.
        long blockSize       = stat.getBlockSize();
        long availableBlocks = stat.getAvailableBlocks();
       
        return( availableBlocks * blockSize );
    }

    /**
     * Obtains the Total internal memory size
     * @return long - integer with total memory size
     */
    public long getTotalInternalMemorySize() {
        File path = Environment.getDataDirectory();
        StatFs stat = new StatFs(path.getPath());
       
        // place in stack variables for debugging purposes.
        long blockSize = stat.getBlockSize();
        long totalBlocks = stat.getBlockCount();
       
        return( totalBlocks * blockSize );
    }
   
    void CollectPackageInformation( Context context )     {
        Log.d(LOG_TAG, "@CollectPackageInformation");

        try {
            PackageManager pm = context.getPackageManager();
            PackageInfo    pi = pm.getPackageInfo(context.getPackageName(), 0);
           
            mPkg_VersionName        = pi.versionName;
            mPkg_PackageName        = pi.packageName;
            mCtx_FilePath           = context.getFilesDir().getAbsolutePath();
           
            mPkg_OSBld_PhoneModel         = android.os.Build.MODEL;
            mPkg_OSBld_AndroidVersion     = android.os.Build.VERSION.RELEASE;
            mPkg_OSBld_Board              = android.os.Build.BOARD;
            mPkg_OSBld_Brand             = android.os.Build.BRAND;
            mPkg_OSBld_Device             = android.os.Build.DEVICE;
            mPkg_OSBld_Display             = android.os.Build.DISPLAY;
            mPkg_OSBld_FingerPrint         = android.os.Build.FINGERPRINT;
            mPkg_OSBld_Host             = android.os.Build.HOST;
            mPkg_OSBld_ID                 = android.os.Build.ID;
            mPkg_OSBld_Model             = android.os.Build.MODEL;
            mPkg_OSBld_Product             = android.os.Build.PRODUCT;
            mPkg_OSBld_Tags             = android.os.Build.TAGS;
            mPkg_OSBld_Time             = android.os.Build.TIME;
            mPkg_OSBld_Type             = android.os.Build.TYPE;
            mPkg_OSBld_User             = android.os.Build.USER;
        } catch( Exception e ) {
            Log.e(LOG_TAG, "!Error CollectPackageInformation: " + e.getMessage());
            // e.printStackTrace()
        }
    }
   
    /**
     * Assemble the package information in a string format
     * @return String - Package information collected
     */
    private String CreateInformationString() {
        CollectPackageInformation( mCurContext );

        String ReturnVal = "";
        ReturnVal  = "  Version  : " + mPkg_VersionName + "\n";
        ReturnVal += "  Package  : " + mPkg_PackageName + "\n";
        ReturnVal += "  FilePath : " + mCtx_FilePath    + "\n\n";
        ReturnVal += "  Package Data \n";
        ReturnVal += "      Phone Model : " + mPkg_OSBld_PhoneModel     + "\n";
        ReturnVal += "      Android Ver : " + mPkg_OSBld_AndroidVersion + "\n";
        ReturnVal += "      Board       : " + mPkg_OSBld_Board          + "\n";
        ReturnVal += "      Brand       : " + mPkg_OSBld_Brand          + "\n";
        ReturnVal += "      Device      : " + mPkg_OSBld_Device         + "\n";
        ReturnVal += "      Display     : " + mPkg_OSBld_Display        + "\n";
        ReturnVal += "      Finger Print: " + mPkg_OSBld_FingerPrint    + "\n";
        ReturnVal += "      Host        : " + mPkg_OSBld_Host           + "\n";
        ReturnVal += "      ID          : " + mPkg_OSBld_ID             + "\n";
        ReturnVal += "      Model       : " + mPkg_OSBld_Model          + "\n";
        ReturnVal += "      Product     : " + mPkg_OSBld_Product        + "\n";
        ReturnVal += "      Tags        : " + mPkg_OSBld_Tags           + "\n";
        ReturnVal += "      Time        : " + mPkg_OSBld_Time           + "\n";
        ReturnVal += "      Type        : " + mPkg_OSBld_Type           + "\n";
        ReturnVal += "      User        : " + mPkg_OSBld_User           + "\n";
        ReturnVal += "  Internal Memory\n";
        ReturnVal += "      Total    : " + (getTotalInternalMemorySize()     /1024) + "k\n";
        ReturnVal += "      Available: " + (getAvailableInternalMemorySize() /1024) + "k\n\n";

        return ReturnVal;
    }
   
    /**
     *Saves the Crash Report to a File with the name stack-timestamp.stacktrace in SD card
     *
           */
    private void SaveAsFile( String ErrorContent ) {
        try    {
            long timestamp = System.currentTimeMillis();
            String ErrFileName = "stack-" + timestamp + ".stacktrace";
           
            FileOutputStream trace = mCurContext.openFileOutput( ErrFileName, Context.MODE_PRIVATE);
            trace.write(ErrorContent.getBytes());
            trace.flush();
            trace.close();
            Log.e(LOG_TAG, "!Error Report: " + ErrFileName + "\n" + ErrorContent);
        } catch( Exception e ) {
            Log.e(LOG_TAG, "!Error SaveAsFile: " + e.getMessage());
        }
    }

    /**
     * Returns an array containing the names of available crash report files.
     *
     * @return an array containing the names of available crash report files.
     */
    private String[] GetCrashErrorFileList() {
        File dir = mCurContext.getFilesDir();

        Log.d(LOG_TAG, "Looking for error files in " + dir.getAbsolutePath());

        // Filter for "stack trace" files
        FilenameFilter filter = new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return name.endsWith(".stacktrace");
            }
        };
        return dir.list(filter);
    }
   
    /**
     * Checks to see if there are any crash reports to send and sends them if they exist
     * Once finished with the report, then the report file is deleted from the system
     *
     * @param _context
     */
    public void CheckCrashErrorAndSendMail(Context _context )
    {
        try {
            if( null == mCtx_FilePath ) {
                mCtx_FilePath = _context.getFilesDir().getAbsolutePath();
            }
            String[] reportFilesList = GetCrashErrorFileList();
            TreeSet<String> sortedFiles = new TreeSet<String>();
            sortedFiles.addAll(Arrays.asList(reportFilesList));
            if((null != reportFilesList) && (0 < reportFilesList.length)) {
               
                String line;
                String WholeErrorText = "";
                int curIndex = 0;
                final int MaxSendMail = 5;
               
                for ( String curString : sortedFiles )
                {
                    if ( curIndex++ <= MaxSendMail )
                    {
                        WholeErrorText+="New Trace collected :\n";
                        WholeErrorText+="=====================\n ";
                        String filePath = mCtx_FilePath + "/" + curString;
                        BufferedReader input = new BufferedReader(new FileReader(filePath));
                        while (( line = input.readLine()) != null) {
                            WholeErrorText += line + "\n";
                        }
                        input.close();
                    }

                    // DELETE FILES !!!!
                    File curFile = new File( mCtx_FilePath + "/" + curString );
                    curFile.delete();
                }
                SendCrashErrorMail( _context , WholeErrorText,_context.getString(R.string.CrashErrorReport_MailTo) );
            }
        } catch( Exception e ) {
            Log.e(LOG_TAG, "!Error CheckCrashErrorAndSendMail: " + e.getMessage());
            // e.printStackTrace();
        }
    }
   
    /**
     * Send out the crash error report via e-mail
     *
     * @param _context
     * @param ErrorContent
     */
    private void SendCrashErrorMail( Context _context, String ErrorContent,String mailTo)    {
        Log.d(LOG_TAG, "SendCrashErrorMail: " + _context.getString(R.string.CrashErrorReport_MailTo));
       
        //Toast.makeText(_context, _context.getString(R.string.CrashErrorReport_ToastText), Toast.LENGTH_LONG).show();

        Intent sendIntent = new Intent(Intent.ACTION_SEND);
        sendIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        sendIntent.putExtra(Intent.EXTRA_EMAIL,    new String[]{_context.getString(R.string.CrashErrorReport_MailTo)});
        sendIntent.putExtra(Intent.EXTRA_SUBJECT, _context.getString(R.string.CrashErrorReport_MailSubject));
        sendIntent.putExtra(Intent.EXTRA_TEXT, ErrorContent + "\n");
        sendIntent.setType("message/rfc822");
        _context.startActivity( sendIntent );
    }
   
    /**
     * Send out the crash report via HTTP connection
     * NOTE: This is currently not used, but here for future implementation
     * @param _context
     * @param ErrorContent
     *
     * The below code would need to be placed on an server to receive HTTP transmissions.
     * upload_server.php
     * <?php       
     *   if ( $_POST['stacktrace'] == "" || $_POST['package_version'] == "" || $_POST['package_name'] == "" ) {       
     *           die("This script is used to collect field test crash stacktraces. No personal information is transmitted, collected or stored.<br/>For more information, please contact <a href='mailto:support@nullwire.com'>email@domain.com</a>");       
     *  }       
     *   $random = rand(1000,9999);       
     *   $version = $_POST['package_version'];       
     *   $package = $_POST['package_name'];       
     *   $handle = fopen($package."-trace-".$version."-".time()."-".$random, "w+");       
     *   fwrite($handle, $_POST['stacktrace']);       
     *   fclose($handle);       
      *  
     *    ?>
     *
     */
    @SuppressWarnings("unused")
    private void SendCrashErrorHTTP( Context _context, String ErrorContent ) {
        Log.d(LOG_TAG, "SendCrashErrorHTTP: " + _context.getString(R.string.CrashErrorReport_URL));
        Toast.makeText(_context, _context.getString(R.string.CrashErrorReport_ToastText), Toast.LENGTH_LONG).show();

        String sError = null;
        // Transmit stack trace with POST request
        DefaultHttpClient httpClient = new DefaultHttpClient();
        HttpPost httpPost = new HttpPost(_context.getString(R.string.CrashErrorReport_URL));
        List <NameValuePair> nvps = new ArrayList <NameValuePair>(); 
        nvps.add(new BasicNameValuePair("package_name", mPkg_PackageName));
        nvps.add(new BasicNameValuePair("package_version", mPkg_VersionName));
        nvps.add(new BasicNameValuePair("phone_model", mPkg_OSBld_PhoneModel));
        nvps.add(new BasicNameValuePair("android_version", mPkg_OSBld_AndroidVersion));
        nvps.add(new BasicNameValuePair("stacktrace", ErrorContent));
       
        try {
             httpPost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
             // We don't care about the response, so we just hope it went well and on with it
            httpClient.execute(httpPost);
        } catch (UnsupportedEncodingException e) {
            sError = e.getMessage();
        } catch (ClientProtocolException e) {
            sError = e.getMessage();
        } catch (IOException e) {
            sError = e.getMessage();
        } finally {
            sError = "Unknown Error condition";
        }
        if( null != sError ) {
            Log.e(LOG_TAG, "!Error SendCrashErrorHTTP: " + sError);
        }
    }
   
// End Class   
}

------------------------------------------------------

You can add this feature by intiating this code in any activity like Loading,SplashScreen.

// Register the Crash Reporting feature
------------------------------------------
        // Initialize ErrorReporter with all required data
        CrashErrorReporter mCrashErrorReporter = CrashErrorReporter.getInstance();
       
       // Activate the ErrorReporter
        mCrashErrorReporter.Init(getApplicationContext());
        mCrashErrorReporter.CheckCrashErrorAndSendMail(getApplicationContext());

-------------------------------------------------

This just works amazing...

Let me know if any problems you have.

Android Developers Blog

Ram's shared items