public class ModelNameTest extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Log.d("ModelNameTest", "BOARD: " + Build.BOARD); Log.d("ModelNameTest", "BRAND: " + Build.BRAND); Log.d("ModelNameTest", "CPU_ABI: " + Build.CPU_ABI); Log.d("ModelNameTest", "..
// Manifest // main.xml // LocationShare.java public class LocationShare extends MapActivity { MapView mMap; MyLocationOverlay2 mLocation; protected boolean isRouteDisplayed() { return false; } public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mMap = (MapView)findViewById(R.id.mapview); MapController mapControl = mMap.getControll..
LocationManager mLocMan; // 위치 관리자 mLocMan = (LocationManager)getSystemService(Context.LOCATION_SERVICE); if(!mLocMan.isProviderEnabled(LocationManager.GPS_PROVIDER)) { msgBox("GPS가 꺼져 있으니 On시켜 주시기 바랍니다 !!"); // GPS 설정 화면으로 이동 Intent gpsOptionsIntent = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS); startActivity(gpsOptionsIntent); }
public void TouchEventExec() { Instrumentation inst = new Instrumentation(); long downTime = SystemClock.uptimeMillis(); long eventTime = SystemClock.uptimeMillis(); MotionEvent event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_DOWN, 100,100, 0); MotionEvent event2 = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_UP, 100, 100, 0); inst.sendPointerSync(event); inst.se..
private String mProvider; private LocationManager mLocMan; // 위치 관리자 //create() mLocMan = (LocationManager)getSystemService(Context.LOCATION_SERVICE); mProvider = mLocMan.getBestProvider(new Criteria(), true); public void SendLocationTimerStart() { mLocMan.requestLocationUpdates(mProvider, 1000, 0, mListener); } // 위에꺼가 세팅되면 아랬것 실행 LocationListener mListener = new LocationListener() { public voi..
@Override public boolean onCreateOptionsMenu(android.view.Menu menu) { super.onCreateOptionsMenu(menu); MenuItem item = menu.add(0, 1, 0, "현 위치로 이동"); item.setIcon(R.drawable.icon); item.setAlphabeticShortcut('a'); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch(item.getItemId()){ case 1 : mMap.getController().animateTo(mLocation.getMyLocation()); break; } r..
//상단에 선언 private boolean isTwoClickBack = false; . . @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(event.getAction() == KeyEvent.ACTION_DOWN){ if(keyCode == KeyEvent.KEYCODE_BACK){ if(!isTwoClickBack){ Toast.makeText(this, "'뒤로'버튼을 한번더 클릭 하시면 종료됩니다." , Toast.LENGTH_SHORT).show(); CntTimer timer = new CntTimer(2000, 1); timer.start(); }else{ finish(); return true; } } } ret..
- Total
- Today
- Yesterday