SHARE
TWEET

Untitled

a guest May 15th, 2011 1,326 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package ua.inazaruk.internalandhidden;
  2.  
  3. import android.app.Activity;
  4. import android.content.Context;
  5. import android.net.wifi.WifiManager;
  6. import android.os.Bundle;
  7. import android.util.Log;
  8.  
  9. import com.android.internal.os.PowerProfile;
  10.  
  11. public class TestActivity extends Activity {
  12.    
  13.     @Override
  14.     public void onCreate(Bundle savedInstanceState) {
  15.         super.onCreate(savedInstanceState);
  16.         setContentView(R.layout.main);
  17.        
  18.         /* example of Internal API */
  19.         PowerProfile profile = new PowerProfile(this);
  20.         int speedSteps = profile.getNumSpeedSteps();
  21.        
  22.         Log.d("Internal API","Speed steps: "+speedSteps);
  23.        
  24.         /* examaple of Hidden API */
  25.         WifiManager wifiManager = (WifiManager)getSystemService(Context.WIFI_SERVICE);
  26.         boolean wifiApEnabled = wifiManager.isWifiApEnabled();
  27.        
  28.         Log.d("Hidden API","Wifi AP enabled:"+wifiApEnabled);
  29.     }
  30. }
RAW Paste Data
Top