본문 바로가기

전체 글288

how to copy a image from server to device package com.helloandroid.imagedownloader; import java.io.BufferedInputStream;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.net.URL;import java.net.URLConnection; import org.apache.http.util.ByteArrayBuffer; import android.util.Log; public class ImageManager { private final String PATH = "/data/data/com.helloandroid.imagedown.. 2016. 11. 6.
when import org.apache.http.util.ByteArrayBuffer; dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:appcompat-v7:23.0.1' compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' ... } Module specific build.gradle - /app/build.gradleandroid { compileSdkVersion 23 buildToolsVersion "23.0.2" ... useLibrary 'org.apache.http.legacy' ... } 2016. 11. 6.
multi number picker in android public class sample extends Activity{ NumberPicker MyNumPicker1, MyNumPicker2, MyNumPicker3; TextView txtMyText; AlertDialog alertdialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.sample_layout); txtMyText = (TextView) findViewById(R.id.txtMyText); txtMyText.setText("5"); txtMyText.setOnClickListener(new View.OnClic.. 2016. 10. 8.
send a data at a dialog written by http://www.masterqna.com/android/20899/%EB%8B%A4%EC%9D%B4%EC%96%BC%EB%A1%9C%EA%B7%B8%EB%A1%9C-%EA%B0%92-%EB%84%98%EA%B2%A8%EC%A3%BC%EA%B8%B0 A/B는 서로 다른 클래스 액티비티 입니당..[이말이 맞나?]A는 A.java구요, B는 B.java 입니다.A에는 커스텀 다이얼로그를 만들어서, 앱 시작 후,A.java 페이지에서 다이얼로그 띄우기 버튼을 누르면 저 다이얼로그가 뜹니다. 그림에선 가려졌지만, 다이얼로그 뒤에는 listview가 있는데요,다이얼로그를 띄운 후, editText란에 이름을 입력하면 list에 제가 입력한 이름이 출력됩니다.[list에 add해서]그리고, 다.. 2016. 10. 8.
Data exchange way with intent Data exchange way with intent OverviewIntent is a powerful concept within the Android universe. An intent is a message that can be thought of as a request that is given to either an activity within your own app, an external application, or a built-in Android service.Think of an intent as a way for an Activity to communicate with the outside Android world. A few key tasks that an intent might be .. 2016. 10. 3.
Preference Example Example 1Project: Tofu-Notes-master View SourceVote up6 votes@Override protected void onCreate(Bundle savedInstanceState) { //setTheme(Umlaut.getCurrentPreferencesTheme(this)); requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); addPreferencesFromResource(R.layout.preferences); OnPreferenceChangeListener listener = new Preference.OnPreferenceChangeListener() { @Ove.. 2016. 10. 2.
About PreferenceFragment with Toolbar package uk.verscreative.materialsettings; import android.media.Ringtone; import android.media.RingtoneManager; import android.preference.ListPreference; import android.preference.PreferenceActivity; import android.content.Context; import android.content.pm.PackageInfo; import android.preference.Preference; import android.app.NotificationManager; import android.preference.PreferenceManager; impor.. 2016. 10. 1.
PrefereceActivity SubActivity with Back Button (arrow) PreferenceActivity1.javapublic class PreferenceActivity1 extends android.preference.PreferenceActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.pref1); } @Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); LinearLayout root = (LinearLayout)findViewBy.. 2016. 9. 25.
ActionBar and PreferenceActivity headers Written by https://xisberto.wordpress.com/2014/11/08/how-to-combine-actionbar-and-preferenceactivity-headers-with-appcompat/ How to combine ActionBar and PreferenceActivity headers with AppCompatUpdate: This is deprecated. Use the new AppCompatDelegate, it’s way better and easier. Follow the instructions on the Android Developers blog.Since the introduction of the Support libraries on Android, P.. 2016. 9. 18.