Android Android Fix CLEARTEXT communication to {IP} not permitted by network security policy java.net.UnknownServiceException: CLEARTEXT communication to 192.168.1.44 not permitted by network security policy Add src\main\res\xml\network_security_config.xml with the following content: <
Android Android: Skip some fragments onBackPressed There is many way can do. —===================================— Very simple!! When you are starting the activity C, from B, use B.finish(). Something like this. Intent i = new Intent(B.
Android android: install sdkman and install gradle 3.3 $ curl -s https://get.sdkman.io | bash Thanks for using... SSSSSSSSSSSSSSS DDDDDDDDDDDDD KKKKKKKKK KKKKKKK SS:::::::::::::::SD::::::::::::DDD K:::::::K K:::::K S:::::SSSSSS::::::SD:::::::::::::::DD K:::::::K K:::::K S:
Android Android: How to use onSavedInstanceState. The Bundle is a container for all the information you want to save. You use the put* functions to insert data into it. Here’s a short list (there
Android Android: Fragment in ViewPager not restored after popBackStack just change getActivity().getSupportFragmentManager() to getChildFragmentManager() when you init viewPagerAdapter viewPager = (HeightWrappingViewPager) view.findViewById(R.id.viewpager); viewPagerAdapter = new CheckListViewPagerAdapter(getChildFragmentManager()); //getActivity().getSupportFragmentManager() viewPager.setAdapter(viewPagerAdapter); ref: http://stackoverflow.com/
Android Android: Get Latitude and Longitude of the mobile device With google things changes very often: non of the previous answers worked for me. April 2016 based on this google training here is how you do it using fused location
Android Android: Read/Write String From A File Write File: private void writeToFile(String data,Context context) { try { OutputStreamWriter outputStreamWriter = new OutputStreamWriter(context.openFileOutput("config.txt", Context.MODE_PRIVATE)); outputStreamWriter.write(data); outputStreamWriter.close(); } catch (IOException e) { Log.
Android Android : Convert String to Date and Date to String From String to Date String dtStart = "2010-10-15T09:27:37Z"; SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); try { Date date = format.parse(dtStart); System.out.println(date); } catch (ParseException e) { // TODO
Android Android: Set default language to thai ตามนี้เลย Locale locale = new Locale("th_TH"); Locale.setDefault(locale);
Android Android: Get complete address from latitude and longitude ประมาณนี้ Geocoder geocoder; List addresses; geocoder = new Geocoder(this, Locale.getDefault()); addresses = geocoder.getFromLocation(latitude, longitude, 1); // Here 1 represent max location result to returned, by documents it recommended 1
Android รีดพลังจาก android สอนโดย google สอนโดย Colt McAnlis ทีมนักพัฒนาของกูเกิล และเปิดให้เรียนฟรีบนเว็บไซต์ Udacity โดยเนื้อหาที่สอนครอบคลุมทั้งเรื่องการเรนเดอร์กราฟิก การจัดการหน่วยความจำ และการสร้างแอพไม่ให้
Android Android : String resource with code String mystring = getResources().getString(R.string.mystring);
Android Android : splash screen เมื่อต้องการเพิ่ม splash screen ให้เพิ่ม loading Activity ไว้ที่ หน้าแรก ตามนี้ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splash); Thread
Android Android : Progress Dialog ProgressDialog เป็น Dialog สำหรับแสดง spinner และข้อความขึ้นมา เพื่อคั่นระหว่าที่มีการ process กระบวนการอะไรก็ตามที่เราต้องการ การแสดงผลขึ้นมา ProgressDialog dialog=new ProgressDialog(MainActivity.this); dialog.
Android Android: Hide and Show soft keyboard /** * Hides the soft keyboard */ public void hideSoftKeyboard() { if(getCurrentFocus()!=null) { InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0); } } /** * Shows the soft keyboard */ public void showSoftKeyboard(View
Android Android: Set และ Get String Array Resource เริ่มจากการกำหนดค่า String Array ใน String.xml Earth Moon @string/earth @string/moon การ get ค่าออกมาจะใช้ String[] itemNames = getResources().getStringArray(R.array.system); ประมาณนี้…
Android Android: Back Button with Attach Data ใน Sdk Version 22 ตอนนที่ใช้งานตอนนี้เป็น Sdk Version 22 import android.content.Intent; import android.support.v4.app.NavUtils; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.
Android Android : สร้าง layout ด้วย code qTextView = new TextView[question.length]; mainRelativeLayout = (RelativeLayout) findViewById(R.id.mainRelativeLayout); for(int i=0; i < question.length; i++) { qTextView[i] = new TextView(this); RelativeLayout.LayoutParams params = new RelativeLayout.
Android Android: แสดง HTML ใน TextView ในการแสดงผล Html ใน TextView ต้องใช้ Html.fromHtml() myTextView.setText(Html.fromHtml("<h2>Title</h2><br><p>Description here</p>
Android Android: แสดงผล Datetime แบบให้คนอ่าน (Format relative date to human readable format in Android) สามารถใช้ Method จาก getRelativeTimeSpanString public static String RelativeDate(Date date) { long timeInMilliseconds = date.getTime(); long now = System.currentTimeMillis(); CharSequence timeSpan = DateUtils.getRelativeTimeSpanString(timeInMilliseconds, now, DateUtils.HOUR_IN_MILLIS); return timeSpan.
Android Android Studio Run Device on Smart Phone and Tablets ก่อนที่จะทดสอบให้เลือก Run -> Edit Configurations เลือก Project ที่ต้องการ และเลือก Target Device เป็น USB device จากนั้นให้เลือก Run หรือคลิ
Android Ionic framework Start Command * cd into your project: $ cd myApp * Setup this project to use Sass: ionic setup sass * Develop in the browser with live reload: ionic serve * Add a platform (ios or Android)