Code example for Context

Methods: getApplicationInfo

0
	 * @param context 
	 *            A Context used to check whether the application is debuggable, 
	 *            this can be the application context 
	 */ 
	public static ViewServer get(Context context) {
		ApplicationInfo info = context.getApplicationInfo();
		if (BUILD_TYPE_USER.equals(Build.TYPE) && (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
			if (sServer == null) {
				sServer = new ViewServer(ViewServer.VIEW_SERVER_DEFAULT_PORT);
			} 
 
			if (!sServer.isRunning()) {
				try { 
					sServer.start();
				} catch (IOException e) {
					Log.d(LOG_TAG, "Error:", e);
				} 
			} 
		} else { 
			sServer = new NoopViewServer();
		}