모바일개발(Mobile Dev)/안드로이드개발(Android)64 to move location at a center of camera activeoldestvotesup vote63down voteacceptedmake sure you have these permissions: Then make some activity and register a LocationListenerpackage com.example.location; import android.content.Context; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.view.View; import com.actionbarsherlock.ap.. 2017. 8. 7. how to use moving on current location The above answer is not according to what Google Doc Referred for Location Tracking in Google api v2.I just followed the official tutorial and ended up with this class that is fetching the current location and centring the map on it as soon as i get that.you can extend this class to have LocationReciever to have periodic Location Update. I just executed this code on api level 7http://developer.a.. 2017. 8. 6. service template in android public class MainActivity extends Activity { private CustomService mService = null; private boolean mIsBound; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); startService(new Intent(this.getBaseContext(), CustomService.class)); doBindService(); } private ServiceConnection mConnection = new ServiceConnection() { @Override public void onServiceCon.. 2017. 7. 27. using parsing round math written by http://2ssoosike.tistory.com/149 ##. 소수점 7자리에서 반올림으로 표현하고 소수점 이상은 3자리마다 콤마표시 String price ="12323445.9090900909"; String result = String.format("%,.7f", Double.parseDouble(price)); System.out.println("output: "+result);결과 - output: 12,323,445.909##. java round func 이용한 반올림? (현재 숫자와 가장 근사치인 정수) String result1 = String.format("%,d", Math.round(Double.parseDouble(price))); System.out.pri.. 2017. 7. 16. Keeping your app Awake in android written by https://developer.android.com/training/scheduling/wakelock.html Keeping the Device Awake이전다음This lesson teaches you toKeep the Screen OnKeep the CPU OnTry it outDOWNLOAD THE SAMPLEScheduler.zipTo avoid draining the battery, an Android device that is left idle quickly falls asleep. However, there are times when an application needs to wake up the screen or the CPU and keep it awake to .. 2017. 7. 16. each toolbar different navigation drawer written by https://stackoverflow.com/questions/35015182/different-toolbar-for-fragments-and-navigation-drawer Different toolbar for fragments and Navigation DrawerAsk Questionup vote7down votefavorite3Please, explain to me... I have Navigation Drawer in my Activity and it syncs with Toolbar(like ActionBar). Activity has few fragments and in different fragments I need to use different AppBar mode.. 2017. 7. 15. when using imageView in camera written by https://stackoverflow.com/questions/34504717/android-app-crashes-on-onactivityresult-while-using-camera-intent/34626655 Follow below steps in order to take picture from camera and display onto ImageView1) Start Camera IntentUri fileUri; String photoPath = ""; private void startingCameraIntent() { String fileName = System.currentTimeMillis()+".jpg"; ContentValues values = new ContentVa.. 2017. 7. 8. how to deal activity value interaction down voteIf you want to pass data from the preference activity to your main activity use this code:In your main activity class (launch):startActivityForResult(new Intent(main.this, preferences.class), 0);In your preference activity class (set the result):Intent i; i.putStringExtra("name", "tom"); setResult(RESULT_OK, i); finish();In your main activity class (get the result):@Override protected v.. 2017. 7. 8. how to use option menu icon each Toolbar in Fragment written by http://gwpark.tistory.com/1993 [ \res\menu\menu_one.xml ] [ \res\menu\menu_two.xml ] [ FragmentOne.java ]public class FragmentOne extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreate(savedInstanceState); // if this is set true, // Activity.onCreateOptionsMenu will call Fragment.onCreateOptionsMe.. 2017. 7. 1. 이전 1 2 3 4 5 6 ··· 8 다음