Android Open Source - androiddevice.info Application






From Project

Back to project page androiddevice.info.

License

The source code is released under:

GNU General Public License

If you think the Android project androiddevice.info listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package info.androiddevice.deviceinventory;
//from ww w  . j  a v  a2 s . c o  m
import android.content.Context;
import android.content.Intent;

import info.androiddevice.deviceinventory.submission.R;

public class Application extends android.app.Application {
    static Context context = null;
    @Override
    public void onCreate() {
        super.onCreate();
        context = this.getApplicationContext();

        Thread.setDefaultUncaughtExceptionHandler (new Thread.UncaughtExceptionHandler()
        {
            @Override
            public void uncaughtException (Thread thread, Throwable t)
            {
                handleUncaughtException (thread, t);
            }
        });
    }

    private void handleUncaughtException (Thread thread, Throwable t)
    {
        try {
            android.content.pm.PackageInfo packageinfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);

            Intent intent = new Intent(Intent.ACTION_SEND);
            intent.setType("plain/text");
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{context.getString(R.string.email)});
            intent.putExtra(android.content.Intent.EXTRA_SUBJECT, context.getString(R.string.subject));
            intent.putExtra(android.content.Intent.EXTRA_TEXT, new Error(packageinfo, t).toString());

            Intent mail = Intent.createChooser(intent, context.getString(R.string.crashtitle));
            mail.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(mail);
        } catch(Exception e) {
        } finally {
            Runtime.getRuntime().exit(0);
        }

    }

    public static Context getContext() {
        return context;
    }
}




Java Source Code List

android.system.ErrnoException.java
android.system.Os.java
android.system.StructStat.java
info.androiddevice.deviceinventory.Application.java
info.androiddevice.deviceinventory.DeviceInformation.java
info.androiddevice.deviceinventory.Error.java
info.androiddevice.deviceinventory.info.CpuinfoProperty.java
info.androiddevice.deviceinventory.info.DirProperty.java
info.androiddevice.deviceinventory.info.DisplayProperty.java
info.androiddevice.deviceinventory.info.EnvironmentProperty.java
info.androiddevice.deviceinventory.info.FeaturesProperty.java
info.androiddevice.deviceinventory.info.FileProperty.java
info.androiddevice.deviceinventory.info.GetPropProperty.java
info.androiddevice.deviceinventory.info.JavaSystemProperty.java
info.androiddevice.deviceinventory.info.MeminfoProperty.java
info.androiddevice.deviceinventory.info.MountsProperty.java
info.androiddevice.deviceinventory.info.NameProperty.java
info.androiddevice.deviceinventory.info.OtacertsProperty.java
info.androiddevice.deviceinventory.info.PackageSigProperty.java
info.androiddevice.deviceinventory.info.Property.java
info.androiddevice.deviceinventory.info.SharedLibraryNamesProperty.java
info.androiddevice.deviceinventory.info.UsbProperty.java
info.androiddevice.deviceinventory.info.Utils.java
info.androiddevice.deviceinventory.info.VersionProperty.java
info.androiddevice.deviceinventory.submission.DeviceInformationListAdapter.java
info.androiddevice.deviceinventory.submission.MainActivity.java
libcore.io.ErrnoException.java
libcore.io.Libcore.java
libcore.io.Os.java
libcore.io.StructStat.java
name.unused.android.utils.systemproperties.SystemProperty.java
name.unused.android.utils.systemproperties.exception.NoSuchPropertyException.java