Android Context Get getMobilityPackageInfo(Context context)

Here you can find the source of getMobilityPackageInfo(Context context)

Description

Returns the mobility package info if mobiliy and accelservice exist

Parameter

Parameter Description
context a parameter

Return

the mobility package info

Declaration

private static PackageInfo getMobilityPackageInfo(Context context) 

Method Source Code

//package com.java2s;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;

public class Main {
    /**/*w  ww  .ja v  a  2  s .  c  o  m*/
     * Returns the mobility package info if mobiliy and accelservice exist
     * 
     * @param context
     * @return the mobility package info
     */
    private static PackageInfo getMobilityPackageInfo(Context context) {
        try {
            PackageManager pm = context.getPackageManager();
            return pm.getPackageInfo("org.ohmage.mobility", 0);
        } catch (PackageManager.NameNotFoundException e) {
            // Don't do anything
        }
        return null;
    }
}

Related

  1. getLineThickness(Context context)
  2. getLocationProvider(Context context)
  3. getLongSPR(String key, Context context)
  4. getMemoryClass(Context context)
  5. getMinFontSize(Context context)
  6. getMobilityVersion(Context context)
  7. getMusesAppContext()
  8. getNameFromUri(Context context, Uri uri)
  9. getOffset(Context context)