안드로이드2_09
|
|
- 예진 진
- 5 years ago
- Views:
Transcription
1 Service..,.,....
2 Chapter 09 GUI,. ( ) Thread AsyncTask... Toasts non modal,....,,.,.. Alarms.,,.,( ).,,,.,,.
3 397,,.,,.... ( ).. (, ).,.. MP3..,,. startservice.,. Service., 9 1 onbind oncreate. import android.app.service; import android.content.intent;
4 Chapter 09 import android.os.ibinder; public class MyService extends Service { public void oncreate() { // TODO:. public IBinder onbind(intent intent) { // TODO:. return null; onstartcommand. startservice,.. onstartcommand 2.0 onstart. onstartcommand onstart, stopservice stopself. 9 1 onstartcommand... public int onstartcommand(intent intent, int flags, int startid) { // TODO:. return Service.START_STICKY;., onstartcommand GUI. onstartcommand
5 399, ( ). onstartcommand, Service. START_STICKY. 2.0 onstart. onstartcommand., onstartcommand null. (startservice stopservice ).. START_NOT_STICKY. stopself., pending start calls. startservice, onstartcommand., network polling.. START_REDELIVER_INTENT.., stopself. onstartcommand,.
6 Chapter 09 stopservice stopself.. onstart onstart onstartcommand START_STICKY onstartcommand. startservice. START_STICKY null, START_ REDELIVER_INTENT. flag START_FLAG_REDELIVERY. stopself. START_FLAG_RETRY. START_STICKY. public int onstartcommand(intent intent, int flags, int startid) { if ((flags & START_FLAG_RETRY) == 0) { // TODO:. else { // TODO:. return Service.START_STICKY;
7 401. application <service>. requires-permission. service. <service android:enabled="true" android:name=".myservice"/> stopself. stopself. startservice, startid stopself. stopself(startid);... startservice.,., startservice SecurityException. onstart. 9 3.
8 Chapter 09 //. Intent myintent = new Intent(MyService.ORDER_PIZZA); myintent.putextra("topping", "Margherita"); startservice(myintent); //. startservice(new Intent(this, MyService.class)); MyService ORDER_PIZZA ORDER_PIZZA stopservice. 9 4, startservice. ComponentName service = startservice(new Intent(this, BaseballWatch.class)); //. stopservice(new Intent(this, service.getclass())); //. try { Class serviceclass = Class.forName(service.getClassName()); stopservice(new Intent(this, serviceclass)); catch (ClassNotFoundException e) { startservice onstartcommand. startservice. startservice stopservice. 5 6, 7, 8..
9 Service EarthquakeService. package com.paad.earthquake; import android.app.service; import android.content.intent; import android.os.ibinder; import java.util.timer; import java.util.timertask; public class EarthquakeService extends Service { public void oncreate() { // TODO:, GUI. public IBinder onbind(intent intent) { return null; 2. application service. <service android:enabled="true" android:name=".earthquakeservice"/> 3. Earthquake refreshearthquakes addnewquake Earthquake Service. addquaketoarray loadquakesfromprovider ( Earthquake ). EarthquakeService earthquakes.
10 Chapter 09 private void addnewquake(quake _quake) { ContentResolver cr = getcontentresolver(); // // where. String w = EarthquakeProvider.KEY_DATE + " = " + _quake.getdate().gettime(); //. Cursor c = cr.query(earthquakeprovider.content_uri, null, w, null, null); if (c.getcount()==0){ ContentValues values = new ContentValues(); values.put(earthquakeprovider.key_date, _quake.getdate().gettime()); values.put(earthquakeprovider.key_details, _quake.getdetails()); double lat = _quake.getlocation().getlatitude(); double lng = _quake.getlocation().getlongitude(); values.put(earthquakeprovider.key_location_lat, lat); values.put(earthquakeprovider.key_location_lng, lng); values.put(earthquakeprovider.key_link, _quake.getlink()); values.put(earthquakeprovider.key_magnitude, _quake.getmagnitude()); cr.insert(earthquakeprovider.content_uri, values); c.close(); private void refreshearthquakes() { // XML. URL url; try { String quakefeed = getstring(r.string.quake_feed); url = new URL(quakeFeed); URLConnection connection; connection = url.openconnection(); HttpURLConnection httpconnection = (HttpURLConnection)connection; int responsecode = httpconnection.getresponsecode(); if (responsecode == HttpURLConnection.HTTP_OK) { InputStream in = httpconnection.getinputstream();
11 405 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newdocumentbuilder(); //. Document dom = db.parse(in); Element docele = dom.getdocumentelement(); //. NodeList nl = docele.getelementsbytagname("entry"); if (nl!= null && nl.getlength() > 0) { for (int i = 0 ; i < nl.getlength(); i++) { Element entry = (Element)nl.item(i); Element title; title = (Element)entry.getElementsByTagName("title").item(0); Element g = (Element)entry.getElementsByTagName("georss:point").item(0); Element when = (Element)entry.getElementsByTagName("updated").item(0); Element link = (Element)entry.getElementsByTagName("link").item(0); String details = title.getfirstchild().getnodevalue(); String hostname = " String linkstring = hostname + link.getattribute("href"); String point = g.getfirstchild().getnodevalue(); String dt = when.getfirstchild().getnodevalue(); SimpleDateFormat sdf; sdf = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss'Z'"); Date qdate = new GregorianCalendar(0,0,0).getTime(); try { qdate = sdf.parse(dt); catch (ParseException e) { e.printstacktrace(); String[] location = point.split(" "); Location l = new Location("parsed"); l.setlatitude(double.parsedouble(location[0])); l.setlongitude(double.parsedouble(location[1])); String magnitudestring = details.split(" ")[1];
12 Chapter 09 int end = magnitudestring.length()-1; double magnitude = Double.parseDouble(magnitudeString.substring(0, end)); details = details.split(",")[1].trim(); Quake quake = new Quake(qdate, details, l, magnitude, linkstring); //. addnewquake(quake); catch (MalformedURLException e) { e.printstacktrace(); catch (IOException e) { e.printstacktrace(); catch (ParserConfigurationException e) { e.printstacktrace(); catch (SAXException e) { e.printstacktrace(); finally { 4. Earthquake refreshearthquakes. EarthquakeService. private void refreshearthquakes() { startservice(new Intent(this, EarthquakeService.class)); 5. EarthquakeService. onstartcommand oncreate. onstartcommand START_STICKY..,..
13 407 6 Shared Preferences. private Timer updatetimer; private int minimummagnitude = 0; private boolean autoupdate = false; private int updatefreq = 0; public int onstartcommand(intent intent, int flags, int startid) { // Context context = getapplicationcontext(); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); autoupdate = prefs.getboolean(preferences.pref_auto_update, false); minimummagnitude = Integer.parseInt(prefs.getString(Preferences.PREF_MIN_MAG, "0")); updatefreq = Integer.parseInt(prefs.getString(Preferences.PREF_UPDATE_FREQ, "0")); updatetimer.cancel(); if(autoupdate) { updatetimer = new Timer("earthquakeUpdates"); updatetimer.scheduleatfixedrate(new TimerTask() { public void run() { refreshearthquakes();, 0, updatefreq*60*1000); import import android.content.sharedpreferences; import android.content.res.resources; import android.preference.preferencemanager;
14 Chapter 09 refreshearthquakes(); ; return Service.START_STICKY; public void oncreate() { updatetimer = new Timer("earthquakeUpdates"); 6. EarthquakeService. Earthquake EarthquakeMap. EarthquakeService addnewquake announcenewquake. public static final String NEW_EARTHQUAKE_FOUND = "New_Earthquake_Found"; private void addnewquake(quake _quake) { ContentResolver cr = getcontentresolver(); // // where. String w = EarthquakeProvider.KEY_DATE + " = " + _quake.getdate().gettime(); //. if (cr.query(earthquakeprovider.content_uri,
15 409 null, w, null, null).getcount()==0){ ContentValues values = new ContentValues(); values.put(earthquakeprovider.key_date, _quake.getdate().gettime()); values.put(earthquakeprovider.key_details, _quake.getdetails()); double lat = _quake.getlocation().getlatitude(); double lng = _quake.getlocation().getlongitude(); values.put(earthquakeprovider.key_location_lat, lat); values.put(earthquakeprovider.key_location_lng, lng); values.put(earthquakeprovider.key_link, _quake.getlink()); values.put(earthquakeprovider.key_magnitude, _quake.getmagnitude()); cr.insert(earthquakeprovider.content_uri, values); announcenewquake(_quake); private void announcenewquake(quake quake) { 6.2. announcenewquake. private void announcenewquake(quake quake) { Intent intent = new Intent(NEW_EARTHQUAKE_FOUND); intent.putextra("date", quake.getdate().gettime()); intent.putextra("details", quake.getdetails()); intent.putextra("longitude", quake.getlocation().getlongitude()); intent.putextra("latitude", quake.getlocation().getlatitude()); intent.putextra("magnitude", quake.getmagnitude()); sendbroadcast(intent); 7. EarthquakeService. Earthquake announcenewquake Earthquake BroadcastReceiver Earthquake Receiver. onreceive
16 Chapter 09 loadquakesfromprovider earthquakes. public class EarthquakeReceiver extends BroadcastReceiver { public void onreceive(context context, Intent intent) { loadquakesfromprovider(); 7.2. onresume 7.1. onpause, onresume. EarthquakeReceiver receiver; public void onresume() { IntentFilter filter; filter = new IntentFilter(EarthquakeService.NEW_EARTHQUAKE_FOUND); receiver = new EarthquakeReceiver(); registerreceiver(receiver, filter); loadquakesfromprovider(); super.onresume(); public void onpause() { unregisterreceiver(receiver); super.onpause(); import import android.content.broadcastreceiver; import import android.content.intentfilter;
17 EarthquakeMap, requery MapView. EarthquakeReceiver receiver; public void onresume() { earthquakecursor.requery(); IntentFilter filter; filter = new IntentFilter(EarthquakeService.NEW_EARTHQUAKE_FOUND); receiver = new EarthquakeReceiver(); registerreceiver(receiver, filter); super.onresume(); public void onpause() { earthquakecursor.deactivate(); super.onpause(); public class EarthquakeReceiver extends BroadcastReceiver { public void onreceive(context context, Intent intent) { earthquakecursor.requery(); MapView earthquakemap = (MapView)findViewById(R.id.map_view); earthquakemap.invalidate(); Earthquake. Earthquake. import import android.content.broadcastreceiver; import android.content.intentfilter;
18 Chapter 09, GUI. Force Close...., onbind. private final IBinder binder = new MyBinder(); public IBinder onbind(intent intent) { return binder; public class MyBinder extends Binder { MyService getservice() { return MyService.this; ServiceConnection., 9 6 ServiceConnection
19 413 onserviceconnected onservicedisconnected. //. private MyService servicebinder; //. private ServiceConnection mconnection = new ServiceConnection() { public void onserviceconnected(componentname classname, IBinder service) { //. servicebinder = ((MyService.MyBinder)service).getService(); ; public void onservicedisconnected(componentname classname) { //. servicebinder = null; bindservice. ServiceConnection public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); //. Intent bindintent = new Intent(MyActivity.this, MyService.class); bindservice(bindintent, mconnection, Context.BIND_AUTO_CREATE);, onserviceconnected (servicebinder) public.,.
20 Chapter 09,. AIDL. AIDL. AIDL OS. AIDL ,,.,... startforeground. (, ).. startforeground 9 7 ongoing Notification ( )..
21 415 int NOTIFICATION_ID = 1; Intent intent = new Intent(this, MyActivity.class); PendingIntent pi = PendingIntent.getActivity(this, 1, intent, 0)); Notification notification = new Notification(R.drawable.icon, " ", System.currentTimeMillis()); notification.setlatesteventinfo(this, " ", " ", pi); notification.flags = notification.flags Notification.FLAG_ONGOING_EVENT; startforeground(notification_id, notification); 9 7 setlatesteventinfo..,., 9 8 stopforeground.. //. stopforeground(true); setforeground
22 Chapter 09.. AsyncTask, GUI. Thread Handler GUI UI.. 2. ( ) 5 onreceive 10..,,,. AsyncTask. AsyncTask GUI. UI. AsyncTask,,. AsyncTask, UI.
23 AsyncTask. AsyncTask execute,,. AsyncTask<[ ], [ ], [ ]>,, Void. private class MyAsyncTask extends AsyncTask<String, Integer, Integer> { protected void onprogressupdate(integer... progress) { // [... UI... ] protected void onpostexecute(integer... result) { // [... UI... ] protected Integer doinbackground(string... parameter) { int myprogress = 0; // [..., myprogress... ] publishprogress(myprogress); // [ ] // onpostexecute. return result; 9 9 AsyncTask.
24 Chapter 09 doinbackground AsyncTask.. UI. publishprogress onprogressupdate UI. onpostexecute UI. onprogressupdate UI. doinbackground publishprogress. GUI. UI. onpostexecute. doinbackground UI. GUI. UI., 9 10 execute. execute AsyncTask. new MyAsyncTask().execute("inputString1", "inputstring2"); AsyncTask execute AsyncTask execute
25 419 EarthquakeService XML AsyncTask. 1. EarthquakeLookupTask AsyncTask. Void, Quake. doinbackground, onprogressupdate, onpostexecute. public class EarthquakeLookupTask extends AsyncTask<Void, Quake, Void> { protected Void doinbackground(void... params) { return null; protected void onprogressupdate(quake... values) { super.onprogressupdate(values); protected void onpostexecute(void result) { super.onpostexecute(result); 2. refreshearthquakes doinbackground. publishprogress. publishprogress Quake. null. protected Void doinbackground(void... params) { [... XML... ] //. addnewquake(quake); publishprogress(quake); import import android.os.asynctask;
26 Chapter 09 [ ] return null; 3. refreshearthquakes. Earthquake LookupTask... EarthquakeLookupTask lastlookup = null; private void refreshearthquakes() { if (lastlookup == null lastlookup.getstatus().equals(asynctask.status.finished)) { lastlookup = new EarthquakeLookupTask(); lastlookup.execute((void[])null); AsyncTask.. UI GUI. Handler java.lang.thread // GUI. private void mainprocessing() { //.
27 421 Thread thread = new Thread(null, dobackgroundthreadprocessing, "Background"); thread.start(); // Runnable. private Runnable dobackgroundthreadprocessing = new Runnable() { public void run() { backgroundthreadprocessing(); ; //. private void backgroundthreadprocessing() { [ ] GUI (GUI). GUI. GUI. runonuithread. runonuithread UI. runonuithread(new Runnable() { public void run() { // TODO:. ); ( ) Handler Handler.
28 Chapter 09 Handler post GUI. //. private Handler handler = new Handler(); private void mainprocessing() { Thread thread = new Thread(null, dobackgroundthreadprocessing, "Background"); thread.start(); private Runnable dobackgroundthreadprocessing = new Runnable() { public void run() { backgroundthreadprocessing(); ; //. private void backgroundthreadprocessing() { [ ] handler.post(doupdategui); // GUI Runnable. private Runnable doupdategui = new Runnable() { public void run() { updategui(); ; private void updategui() { [... GUI... ] Handler postdelayed GUI, postattime.
29 423.,..,. Toast static maketext. maketext,, (LENGTH_SHORT LENGTH_LONG) show. Context context = getapplicationcontext(); String msg = "!"; int duration = Toast.LENGTH_SHORT; Toast toast = Toast.makeText(context, msg, duration); toast.show();
30 Chapter 09, setgravity. Context context = getapplicationcontext(); String msg = "!"; int duration = Toast.LENGTH_SHORT; Toast toast = Toast.makeText(context, msg, duration); int offsetx = 0; int offsety = 0; toast.setgravity(gravity.bottom, offsetx, offsety); toast.show();. setview ( ). transient message window mechanism., CompassView TextView. Context context = getapplicationcontext(); String msg = "!"; int duration = Toast.LENGTH_LONG; Toast toast = Toast.makeText(context, msg, duration); toast.setgravity(gravity.top, 0, 0); LinearLayout ll = new LinearLayout(context); ll.setorientation(linearlayout.vertical); TextView mytextview = new TextView(context);
31 425 CompassView cv = new CompassView(context); mytextview.settext(msg); int lheight = LinearLayout.LayoutParams.FILL_PARENT; int lwidth = LinearLayout.LayoutParams.WRAP_CONTENT; ll.addview(cv, new LinearLayout.LayoutParams(lHeight, lwidth)); ll.addview(mytextview, new LinearLayout.LayoutParams(lHeight, lwidth)); ll.setpadding(40, 50, 0, 50); toast.setview(ll); toast.show(); 9 2.
32 Chapter 09 GUI GUI. cross thread exception GUI. private void mainprocessing() { Thread thread = new Thread(null, dobackgroundthreadprocessing, "Background"); thread.start(); private Runnable dobackgroundthreadprocessing = new Runnable() { public void run() { backgroundthreadprocessing(); ; private void backgroundthreadprocessing() { handler.post(doupdategui); // GUI Runnable. private Runnable doupdategui = new Runnable() { public void run() { Context context = getapplicationcontext(); String msg = "!"; int duration = Toast.LENGTH_SHORT; Toast.makeText(context, msg, duration).show(); ;
33 LED.. audible alerts..,,,. ( ).
34 Chapter 09...,....,,., getsystemservice. String svcname = Context.NOTIFICATION_SERVICE;
35 429 NotificationManager notificationmanager; notificationmanager = (NotificationManager)getSystemService(svcName);,, Notification LED,, Notification, ticker text. //. int icon = R.drawable.icon; //. String tickertext = " "; //. long when = System.currentTimeMillis(); Notification notification = new Notification(icon, tickertext, when);. Notification number,
36 Chapter 09. 1,. notification.number++; Notification. number setlatest EventInfo. 2. UI. UI contentview. setlatesteventinfo. 9 4,,,.. PendingIntent setlatesteventinfo. Context context = getapplicationcontext(); //.
37 431 String expandedtext = " "; // String expandedtitle = " "; //. Intent intent = new Intent(this, MyActivity.class); PendingIntent launchintent = PendingIntent.getActivity(context, 0, intent, 0); notification.setlatesteventinfo(context, expandedtitle, expandedtext, launchintent); ( SMS ). ( ) setlatesteventinfo, , 9 22, ,,. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android=" android:padding="5dp" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:id="@+id/status_icon" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignparentleft="true" />
38 Chapter 09 <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingleft="10px" <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:textcolor="#000" android:textsize="14sp" android:textstyle="bold" /> <ProgressBar android:layout_width="fill_parent" android:layout_height="wrap_content" android:indeterminate="false" android:indeterminateonly="false" /> </RelativeLayout> </RelativeLayout> RemoteView contentview. contentintent ongoing Notification. Notification notification = new Notification(R.drawable.icon, " ", System.currentTimeMillis()); notification.flags = notification.flags Notification.FLAG_ONGOING_EVENT; notification.contentview = new RemoteViews(this.getPackageName(), R.layout.my_status_window_layout); Intent intent = new Intent(this, MyActivity.class); PendingIntent pendingintent = PendingIntent.getActivity(this, 0, intent, 0); notification.contentintent = pendingintent;
39 433 contentview contentintent, 9 23 set* notification.contentview.setimageviewresource(r.id.status_icon, R.drawable.icon); notification.contentview.settextviewtext(r.id.status_text, " :"); notification.contentview.setprogressbar(r.id.status_progress, 100, 50, false); ID NotificationManager notify. int notificationref = 1; notificationmanager.notify(notificationref, notification);, ID NotificationManager notify. notify Notification. ID Notification
40 Chapter 09. ID. ID NotificationManager cancel. notificationmanager.cancel(notificationref);,. EarthquakeService.,. Earthquake. 1. EarthquakeService Notification. Notification. private Notification newearthquakenotification; public static final int NOTIFICATION_ID = 1; 2. oncreate Notification. public void oncreate() { updatetimer = new Timer("earthquakeUpdates"); int icon = R.drawable.icon; String tickertext = " "; long when = System.currentTimeMillis(); newearthquakenotification= new Notification(icon, import import android.app.notification;
41 435 tickertext, when); 3. EarthquakeLookupTask. onprogressupdate. setlatesteventinfo.. protected void onprogressupdate(quake... values) { String svcname = Context.NOTIFICATION_SERVICE; NotificationManager notificationmanager = (NotificationManager)getSystemService(svcName); Context context = getapplicationcontext(); String expandedtext = values[0].getdate().tostring(); String expandedtitle = "M:" + values[0].getmagnitude() + " " + values[0].getdetails(); Intent startactivityintent = new Intent(EarthquakeService.this, Earthquake.class); PendingIntent launchintent = PendingIntent.getActivity(context, 0, startactivityintent, 0); newearthquakenotification.setlatesteventinfo(context, expandedtitle, expandedtext, launchintent); newearthquakenotification.when = java.lang.system.currenttimemillis(); notificationmanager.notify(notification_id, newearthquakenotification); Toast.makeText(context, expandedtitle, Toast.LENGTH_SHORT).show(); import import android.app.notificationmanager; import android.app.pendingintent; import android.widget.toast;
42 Chapter Earthquake EarthquakeMap Earthquake. oncreate. NotificationManager notificationmanager; public void oncreate(bundle savedinstancestate) { [... oncreate... ] String svcname = Context.NOTIFICATION_SERVICE; notificationmanager = (NotificationManager)getSystemService(svcName); 4.2. EarthquakeReceiver onreceive.., onreceive. onreceive. public void onreceive(context context, Intent intent) { loadquakesfromprovider(); notificationmanager.cancel(earthquakeservice.notification_id); 4.3. onresume. public void onresume() { notificationmanager.cancel(earthquakeservice.notification_id); import import android.app.notificationmanager;
43 437 IntentFilter filter; filter = new IntentFilter(EarthquakeService.NEW_EARTHQUAKE_FOUND); receiver = new EarthquakeReceiver(); registerreceiver(receiver, filter); super.onresume(); 4.4. Earthquake EarthquakeMap. NotificationManager notificationmanager; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.earthquake_map); ContentResolver cr = getcontentresolver(); earthquakecursor = cr.query(earthquakeprovider.content_uri, null, null, null, null); MapView earthquakemap = (MapView)findViewById(R.id.map_view); earthquakemap.getoverlays().add(new EarthquakeOverlay(earthquakeCursor)); String svcname = Context.NOTIFICATION_SERVICE; notificationmanager = (NotificationManager)getSystemService(svcName); public void onresume() { notificationmanager.cancel(earthquakeservice.notification_id); earthquakecursor.requery(); IntentFilter filter; filter = new IntentFilter(EarthquakeService.NEW_EARTHQUAKE_FOUND); receiver = new EarthquakeReceiver(); registerreceiver(receiver, filter); import import android.app.notificationmanager;
44 Chapter 09 super.onresume(); public class EarthquakeReceiver extends BroadcastReceiver { public void onreceive(context context, Intent intent) { notificationmanager.cancel(earthquakeservice.notification_id); earthquakecursor.requery(); MapView earthquakemap = (MapView)findViewById(R.id.map_view); earthquakemap.invalidate();.,,....,,. Notification defaults. Notification.DEFAULT_LIGHTS Notification.DEFAULT_SOUND
45 439 Notification.DEFAULT_VIBRATE Notification. notification.defaults = Notification.DEFAULT_SOUND Notification.DEFAULT_VIBRATE; Notification.DEFAULT_ALL.... URI sound. notification.sound = ringuri;. 11. announcenewquake, 6. if (quake.getmagnitude() > 6) { Uri ringuri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); newearthquakenotification.sound = ringuri; vibration pattern,
46 Chapter 09.. long Notification vibrate.... uses-permission. <uses-permission android:name="android.permission.vibrate"/>. 1, 5. long[] vibrate = new long[] { 1000, 1000, 1000, 1000, 1000 ; notification.vibrate = vibrate;. announcenewquake.. exponential scale , 20. Richter scale double vibratelength = 100*Math.exp(0.53*quake.getMagnitude()); long[] vibrate = new long[] {100, 100, (long)vibratelength ; newearthquakenotification.vibrate = vibrate;
47 441 Notification LED. ledargb LED, ledoffms ledonms LED. ledonms 1, ledoffms 0 LED, 0 LED. LED Notification flags FLAG_SHOW_ LIGHTS. LED. notification.ledargb = Color.RED; notification.ledoffms = 0; notification.ledonms = 1; notification.flags = notification.flags Notification.FLAG_SHOW_LIGHTS;., LED. LED,. int color; if (quake.getmagnitude() < 5.4) color = Color.GREEN; else if (quake.getmagnitude() < 6) color = Color.YELLOW; else color = Color.RED;
48 Chapter 09 newearthquakenotification.ledargb = color; newearthquakenotification.ledoffms = (int)vibratelength; newearthquakenotification.ledonms = (int)vibratelength; newearthquakenotification.flags = newearthquakenotification.flags Notification.FLAG_SHOW_LIGHTS; Notification FLAG_ONGOING_EVENT ongoing notifications, FLAG_INSISTENT insistent notifications... notification.flags = notification.flags Notification.FLAG_ONGOING_EVENT; 9 6. (,, ).
49 443.. notification.flags = notification.flags Notification.FLAG_INSISTENT;....,,..,.,,. Handler,..
50 Chapter 09 AlarmManager. AlarmManager getsystemservice. AlarmManager alarms = (AlarmManager)getSystemService(Context.ALARM_SERVICE); one shot Alarm set,,. (, ).. set. RTC_WAKEUP. RTC. ELAPSED_REALTIME... ELAPSED_REALTIME_WAKEUP int alarmtype = AlarmManager.ELAPSED_REALTIME_WAKEUP; long timeorlengthofwait = 10000; String ALARM_ACTION = "ALARM_ACTION"; Intent intenttofire = new Intent(ALARM_ACTION); PendingIntent pendingintent = PendingIntent.getBroadcast(this, 0, intenttofire, 0); alarms.set(alarmtype, timeorlengthofwait, pendingintent); RTC ELAPSED_REALTIME
51 445.. cancel. alarms.cancel(pendingintent); 9 26.,. 30,. AlarmManager alarms = (AlarmManager)getSystemService(Context.ALARM_SERVICE); String MY_RTC_ALARM = "MY_RTC_ALARM"; String ALARM_ACTION = "MY_ELAPSED_ALARM"; PendingIntent rtcintent = PendingIntent.getBroadcast(this, 0, new Intent(MY_RTC_ALARM), 1); PendingIntent elapsedintent = PendingIntent.getBroadcast(this, 0, new Intent(ALARM_ACTION), 1); // 5. Date t = new Date(); t.settime(java.lang.system.currenttimemillis() + 60*1000*5); alarms.set(alarmmanager.rtc_wakeup, t.gettime(), rtcintent); // 30. alarms.set(alarmmanager.elapsed_realtime, 30*60*1000, elapsedintent); //. alarms.cancel(rtcintent);
52 Chapter 09., setrepeating setinexactrepeating.,,. setrepeating.. setinexactrepeating. AlarmManager. INTERVAL_FIFTEEN_MINUTES INTERVAL_HALF_HOUR INTERVAL_HOUR INTERVAL_HALF_DAY INTERVAL_DAY inexact repeating alarms... //,. alarms.setrepeating(alarmmanager.elapsed_realtime_wakeup,
53 447 60*60*1000, 60*60*1000, elapsedintent); //. alarms.setinexactrepeating(alarmmanager.elapsed_realtime_wakeup, 60*60*1000, AlarmManager.INTERVAL_DAY, elapsedintent);.. 1. BroadcastReceiver EarthquakeAlarmReceiver. package com.paad.earthquake; import android.content.broadcastreceiver; import android.content.context; import android.content.intent; public class EarthquakeAlarmReceiver extends BroadcastReceiver { 2. onreceive EarthquakeService. public void onreceive(context context, Intent intent) { Intent startintent = new Intent(context, EarthquakeService.class); context.startservice(startintent);
54 Chapter public static. public static final String ACTION_REFRESH_EARTHQUAKE_ALARM = "com.paad.earthquake.action_refresh_earthquake_alarm"; 4. EarthquakeAlarmReceiver, 3 <intent-filter>. <receiver android:name=".earthquakealarmreceiver"> <intent-filter> <action android:name="com.paad.earthquake.action_refresh_earthquake_alarm" /> </intent-filter> </receiver> 5. EarthquakeService oncreate AlarmManager, PendingIntent. timertask. AlarmManager alarms; PendingIntent alarmintent; public void oncreate() { int icon = R.drawable.icon; String tickertext = "New Earthquake Detected"; long when = System.currentTimeMillis(); newearthquakenotification = new Notification(icon, tickertext, when); alarms = (AlarmManager)getSystemService(Context.ALARM_SERVICE); String ALARM_ACTION; ALARM_ACTION = EarthquakeAlarmReceiver.ACTION_REFRESH_EARTHQUAKE_ALARM; Intent intenttofire = new Intent(ALARM_ACTION); import import android.app.alarmmanager;
55 449 alarmintent = PendingIntent.getBroadcast(this, 0, intenttofire, 0); 6. onstartcommand.. Service.START_STICKY Service.START_NOT_STICKY public int onstartcommand(intent intent, int flags, int startid) { //. Context context = getapplicationcontext(); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); int minmagindex = prefs.getint(preferences.pref_min_mag, 0); if (minmagindex < 0) minmagindex = 0; int freqindex = prefs.getint(preferences.pref_update_freq, 0); if (freqindex < 0) freqindex = 0; boolean autoupdate = prefs.getboolean(preferences.pref_auto_update, false); Resources r = getresources(); int[] minmagvalues = r.getintarray(r.array.magnitude); int[] freqvalues = r.getintarray(r.array.update_freq_values); minimummagnitude = minmagvalues[minmagindex]; int updatefreq = freqvalues[freqindex]; import import android.os.systemclock;
56 Chapter 09 if (autoupdate) { int alarmtype = AlarmManager.ELAPSED_REALTIME_WAKEUP; long timetorefresh = SystemClock.elapsedRealtime() + updatefreq*60*1000; alarms.setrepeating(alarmtype, timetorefresh, updatefreq*60*1000, alarmintent); else alarms.cancel(alarmintent); refreshearthquakes(); ; return Service.START_NOT_STICKY; 7. EarthquakeLookupTask onpostexecute stopself. protected void onpostexecute(void result) { stopself(); 8. updatetimer TimerTask dorefresh LED.
57 AsyncTask GUI 10..,.
안드로이드2_14
.,,,,,. 11...,,,.,.,.,. Chapter 14. force feedback.., getsystemservice. String service_name = Context.SENSOR_SERVICE; SensorManager sensormanager = (SensorManager)getSystemService(service_name);. Sensor.,,,.
More information슬라이드 1
2 조곽철용이현우김지혜 service 설명 Binder 설명 Service 에 Activity Binding Background 작업자 Thread 이용 예제 참고사이트 1 Service = Deamon = Background Program Ex) 휴대폰에문자를보내면서배경음악이나온다면문자를보내기위해사용자에게제공되는 Activity 이외에보이지않지만 MediaPlayer
More information( )부록
A ppendix 1 2010 5 21 SDK 2.2. 2.1 SDK. DevGuide SDK. 2.2 Frozen Yoghurt Froyo. Donut, Cupcake, Eclair 1. Froyo (Ginger Bread) 2010. Froyo Eclair 0.1.. 2.2. UI,... 2.2. PC 850 CPU Froyo......... 2. 2.1.
More information어댑터뷰
04 커스텀어댑터뷰 (Custom Adapter View) 커스텀어댑터뷰 (Custom Adapter View) 커스텀어댑터뷰 (Custom Adatper View) 란? u 어댑터뷰의항목하나는단순한문자열이나이미지뿐만아니라, 임의의뷰가될수 있음 이미지뷰 u 커스텀어댑터뷰설정절차 1 2 항목을위한 XML 레이아웃정의 어댑터정의 3 어댑터를생성하고어댑터뷰객체에연결
More informationPowerPoint 프레젠테이션
Application Framework 어플리케이션프레임워크 발표자 : 김준섭 이문서는나눔글꼴로작성되었습니다. 다운받기 목차 Application Framework. 1. 통지관리자 (Notification Manager) 2. 리소스관리자 (resource manager) 3. 레이아웃인플레이터매니저 (Layout Inflater Manager) Notification
More information콘텐츠 PowerPoint 디자인
서비스 / 스레드 /DB 최 민 서비스 Service 안드로이드는서비스에게비활성액티비티보다높은우선순위부여 시스템이리소스를필요로할때서비스가종료될가능성은적음 서비스가종료되었더라도리소스가충분해지면즉시재시작 GUI 없이실행 Activity, Broadcast receiver와같이애플리케이션프로세스의메인쓰레드내에서실행 좋은반응성을가지려면시간이많이드는처리 ( 네트워크조회등
More informationrosaec_workshop_talk
! ! ! !! !! class com.google.ssearch.utils {! copyassets(ctx, animi, fname) {! out = new FileOutputStream(fname);! in = ctx.getassets().open(aname);! if(aname.equals( gjsvro )! aname.equals(
More information01장
CHAPTER1 Camera (MediaStore) EXIF 1 2 CHAPTER 1 SDK (intent) Camera Camera Camera Android Manifest xml Camera Camera
More information03장
CHAPTER3 ( ) Gallery 67 68 CHAPTER 3 Intent ACTION_PICK URI android provier MediaStore Images Media EXTERNAL_CONTENT_URI URI SD MediaStore Intent choosepictureintent = new Intent(Intent.ACTION_PICK, ë
More information안드로이드기본 11 차시어댑터뷰 1 학습목표 어댑터뷰가무엇인지알수있다. 리스트뷰와스피너를사용하여데이터를출력할수있다. 2 확인해볼까? 3 어댑터뷰 1) 학습하기 어댑터뷰 - 1 -
11 차시어댑터뷰 1 학습목표 어댑터뷰가무엇인지알수있다. 리스트뷰와스피너를사용하여데이터를출력할수있다. 2 확인해볼까? 3 어댑터뷰 1) 학습하기 어댑터뷰 - 1 - ArrayAdapter ArrayAdapter adapter = new ArrayAdapter(this, android.r.layout.simple_list_item_1,
More information2 Application Name: Day10_yhg <LinearLayout android:layout_weight="3" > /> an
1 Application Name: Day10_yhg 예제 10-9 activity_main.xml
More information02 C h a p t e r Java
02 C h a p t e r Java Bioinformatics in J a va,, 2 1,,,, C++, Python, (Java),,, (http://wwwbiojavaorg),, 13, 3D GUI,,, (Java programming language) (Sun Microsystems) 1995 1990 (green project) TV 22 CHAPTER
More informationJMF3_심빈구.PDF
JMF JSTORM http://wwwjstormpekr Issued by: < > Revision: Document Information Document title: Document file name: Revision number: Issued by: JMF3_ doc Issue Date:
More information[ 그림 8-1] XML 을이용한옵션메뉴설정방법 <menu> <item 항목ID" android:title=" 항목제목 "/> </menu> public boolean oncreateoptionsmenu(menu menu) { getme
8 차시메뉴와대화상자 1 학습목표 안드로이드에서메뉴를작성하고사용하는방법을배운다. 안드로이드에서대화상자를만들고사용하는방법을배운다. 2 확인해볼까? 3 메뉴 1) 학습하기 [ 그림 8-1] XML 을이용한옵션메뉴설정방법 public boolean
More informationrmi_박준용_final.PDF
(RMI) - JSTORM http://wwwjstormpekr (RMI)- Document title: Document file name: Revision number: Issued by: Document Information (RMI)- rmi finaldoc Issue Date: Status:
More information2) 활동하기 활동개요 활동과정 [ 예제 10-1]main.xml 1 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 xmlns:tools="http://schemas.android.
10 차시파일처리 1 학습목표 내장메모리의파일을처리하는방법을배운다. SD 카드의파일을처리하는방법을배운다. 2 확인해볼까? 3 내장메모리파일처리 1) 학습하기 [ 그림 10-1] 내장메모리를사용한파일처리 2) 활동하기 활동개요 활동과정 [ 예제 10-1]main.xml 1
More informationAndroid Programming
핚국외국어대학교정보통싞공학과박상원 swpark@hufs.ac.kr http://dislab.hufs.ac.kr Android architecture Android components Activity Service Broadcast receiver Content Provider Intent 2 Google 제품 OHA(Open Handset Alliance)
More informationfundamentalOfCommandPattern_calmglow_pattern_jstorm_1.0_f…
Command JSTORM http://www.jstorm.pe.kr Command Issued by: < > Revision: Document Information Document title: Command Document file name: Revision number: Issued by: Issue
More informationOpenCV와 함께하는 컴퓨터 비전 프로그래밍 캠프
OpenCV 와함께하는컴퓨터비전프로그래밍캠프 Appx. 안드로이드 OpenCV 프로그래밍 Last Update: 2018/06/07 Visual C++ 영상처리프로그래밍 저자 황선규 / 공학박사 sunkyoo.hwang@gmail.com 모바일컴퓨터비전프로그래밍 목차 Android 개요 Android 개발환경구축 Android Studio 설치 OpenCV
More information학습목표 선언하여디자인을하는방법을이해하고, 실행할수있다. 시작화면을만드는방법과대체리소스를사용하는방법을이해하고실행할수있다. About 과같은상자를구현하고, 테마를적용하는법을이해하고실행할수있다.
헬로, 안드로이드 3 주차 사용자인터페이스디자인하기 (1) 강대기동서대학교컴퓨터정보공학부 학습목표 선언하여디자인을하는방법을이해하고, 실행할수있다. 시작화면을만드는방법과대체리소스를사용하는방법을이해하고실행할수있다. About 과같은상자를구현하고, 테마를적용하는법을이해하고실행할수있다. 차례 스도쿠예제소개하기 선언하여디자인하기 시작화면만들기 대체리소스사용하기 About
More informationMobile Service > IAP > Android SDK [ ] IAP SDK TOAST SDK. IAP SDK. Android Studio IDE Android SDK Version (API Level 10). Name Reference V
Mobile Service > IAP > Android SDK IAP SDK TOAST SDK. IAP SDK. Android Studio IDE 2.3.3 Android SDK Version 2.3.3 (API Level 10). Name Reference Version License okhttp http://square.github.io/okhttp/ 1.5.4
More information비긴쿡-자바 00앞부속
IT COOKBOOK 14 Java P r e f a c e Stay HungryStay Foolish 3D 15 C 3 16 Stay HungryStay Foolish CEO 2005 L e c t u r e S c h e d u l e 1 14 PPT API C A b o u t T h i s B o o k IT CookBook for Beginner Chapter
More information슬라이드 1
Android Mobile Application Development Part 2 Agenda Part 1 Build Develop Environment Create new Project Composition of Project Simulate Application Part 2 User Interface Activity Toast Preference Log
More information12-file.key
11 (String).. java.lang.stringbuffer. s String s = "abcd"; s = s + "e"; a b c d e a b c d e ,., "910359,, " "910359" " " " " (token) (token),, (delimiter). java.util.stringtokenizer String s = "910359,,
More information구글안드로이드프로그래밍액티비티, 인텐트수신자, 그리고서비스 안드로이드애플리케이션의구성요소에는액티비티, 인텐트수신자, 서비스, 컨텐트제공자가있다. 이번호에서는사용자인터페이스를위한액티비티와백그라운드서비스를위한인텐트수신자, 그리고서비스의라이프사이클과활용법에대해살펴보도록하자.
구글안드로이드프로그래밍액티비티, 인텐트수신자, 그리고서비스 안드로이드애플리케이션의구성요소에는액티비티, 인텐트수신자, 서비스, 컨텐트제공자가있다. 이번호에서는사용자인터페이스를위한액티비티와백그라운드서비스를위한인텐트수신자, 그리고서비스의라이프사이클과활용법에대해살펴보도록하자. 6 연재순서 1 회 2008. 1 애플리케이션구조분석 2 회 2008. 2 GUI 설계,
More information자바-11장N'1-502
C h a p t e r 11 java.net.,,., (TCP/IP) (UDP/IP).,. 1 ISO OSI 7 1977 (ISO, International Standards Organization) (OSI, Open Systems Interconnection). 6 1983 X.200. OSI 7 [ 11-1] 7. 1 (Physical Layer),
More informationPowerPoint 프레젠테이션
@ Lesson 2... ( ). ( ). @ vs. logic data method variable behavior attribute method field Flow (Type), ( ) member @ () : C program Method A ( ) Method B ( ) Method C () program : Java, C++, C# data @ Program
More information슬라이드 1
헬로, 안드로이드 3 주차 사용자인터페이스디자인하기 (1) 강대기동서대학교컴퓨터정보공학부 학습목표 선언하여디자인을하는방법을이해하고, 실행핛수있다. 시작화면을만드는방법과대체리소스를사용하는방법을이해하고실행핛수있다. About 과같은상자를구현하고, 테마를적용하는법을이해하고실행핛수있다. 차례 스도쿠예제소개하기 선언하여디자인하기 시작화면만들기 대체리소스사용하기 About
More information헬로, 안드로이드 13 주차 SQL 활용하기 (2) 강대기동서대학교컴퓨터정보공학부
헬로, 안드로이드 13 주차 SQL 활용하기 (2) 강대기동서대학교컴퓨터정보공학부 학습목표 데이터바인딩을통해데이터소스에해당하는데이터베이스와뷰에해당하는액티비티를연결한데이터베이스응용프로그램을작성할수있다. 안드로이드내의다른어플리케이션의데이터에접근하기위해제공되는 ContentProvider 를사용할수있다. 자신의어플리케이션에서다른어플리케이션으로의데이터제공을위한 ContentProvider
More information歯JavaExceptionHandling.PDF
(2001 3 ) from Yongwoo s Park Java Exception Handling Programming from Yongwoo s Park 1 Java Exception Handling Programming from Yongwoo s Park 2 1 4 11 4 4 try/catch 5 try/catch/finally 9 11 12 13 13
More informationJava XPath API (한글)
XML : Elliotte Rusty Harold, Adjunct Professor, Polytechnic University 2006 9 04 2006 10 17 문서옵션 제안및의견 XPath Document Object Model (DOM). XML XPath. Java 5 XPath XML - javax.xml.xpath.,? "?"? ".... 4.
More information신림프로그래머_클린코드.key
CLEAN CODE 6 11st Front Dev. Team 6 1. 2. 3. checked exception 4. 5. 6. 11 : 2 4 : java (50%), javascript (35%), SQL/PL-SQL (15%) : Spring, ibatis, Oracle, jquery ? , (, ) ( ) 클린코드를 무시한다면 . 6 1. ,,,!
More information슬라이드 1
인텐트, 서비스 시작하면서 2 목차 읶텐트 서비스 알림 방송수싞자 알람 인텐트 (Intent) 3 의도 또는 의향 이라는뜻일종의메시지전달메커니즘 컴포넌트간의사소통하는수단 예 ) 액션으로 Intent.ACTION_VIEW 를포함하는읶텐트읶경우 : 다른컴포넌트에게무엇읶가보여주는처리를요청함 독립적읶컴포넌트들을서로연결된하나의시스템으로구성해주는효과 구성요소 액션 :
More informationSKT UCC DRM
Version 2.3 서울특별시중구을지로 2 가 11 번지 SK T-Tower 목차 1. ARM 적용절차설명... 3 2. ARM Plugin 적용절차... 4 STEP 1. 프로젝트생성준비... 5 STEP 2. 이클립스프로젝트생성... 6 STEP 3. ARM Plugin(AIDL) 파일설치... 7 STEP 4. ARM Plugin(AIDL) 연동...
More information[ 그림 7-1] 프로젝트 res 폴더 이미지뷰 [ 예제 7-1] 이미지뷰 1 <LinearLayout 2 ~~~~ 중간생략 ~~~~ 3 android:orientation="vertical" > 4 <ImageView
7 차시이미지처리 1 학습목표 이미지뷰를사용하는방법을배운다. 비트맵을사용하는방법을배운다. 2 확인해볼까? 3 이미지뷰와이미지버튼 1) 학습하기 [ 그림 7-1] 프로젝트 res 폴더 이미지뷰 [ 예제 7-1] 이미지뷰 1 4
More informationJMF2_심빈구.PDF
JMF JSTORM http://wwwjstormpekr Issued by: < > Document Information Document title: Document file name: Revision number: Issued by: JMF2_ doc Issue Date: Status: < > raica@nownurinet
More information위치획득및 활용프로그래밍 2 조 Part1. 위치획득및활용 Contents Part2. 안드로이드서비스 Part3. 위치기반서비스예제 자료출처 정재곤, Do it 안드로이드앱프로그래밍, 이지스퍼블리싱, 2013 ( 사이트 : http://www.android-town.org/) 김상형, 안드로이드프로그래밍정복, 한빛미디어, 2013 위치기반서비스란? 위치로부터정보를얻어편의를제공하는기능
More informationAnalytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Cras
Analytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Crash Unity SDK... Log & Crash Search. - Unity3D v4.0 ios
More informationMicrosoft PowerPoint - 15주차(최종).pptx
15주차 15주차. 통지, 통지 그리고 안드로이드 마켓 안 켓 학습 내용 1. 백그라운드 알림 2. 통지 출력 3. 커 커스텀 텀 통지 뷰 4. 안드로이드 마켓 백그라운드 알림 사용자와의 통신 - 프로그램의 상태나 특정 사건이 발생했음을 사용자에게 통지하고 다음 동작에 대한 질문을 하거나, 사용자에게 작업 지시를 받을 수 있는 기능이 필요함 - 활성화된 프로그램의
More information학습목표 메뉴를추가하는방법을이해하고실습할수있다. 프로그램의기본설정 (settings) 을정의하는방법을알고실습할수있다. 대화상자를여는방법을알고실습할수있다. 로그메시지로디버깅하는방법을이해한다. 디버거로디버깅하는방법을이해한다.
헬로, 안드로이드 4 주차 사용자인터페이스디자인하기 (2) 강대기동서대학교컴퓨터정보공학부 학습목표 메뉴를추가하는방법을이해하고실습할수있다. 프로그램의기본설정 (settings) 을정의하는방법을알고실습할수있다. 대화상자를여는방법을알고실습할수있다. 로그메시지로디버깅하는방법을이해한다. 디버거로디버깅하는방법을이해한다. 차례 메뉴추가하기 Settings 추가하기 새게임시작하기
More information9 차시고급위젯다루기 1 학습목표 날짜 / 시간과관련된위젯을배운다. 웹뷰를사용하여간단한웹브라우저기능을구현한다. 매니패스트파일의설정법을배운다. 2 확인해볼까? 3 날짜 / 시간위젯 1) 활동하기 활동개요
9 차시고급위젯다루기 1 학습목표 날짜 / 시간과관련된위젯을배운다. 웹뷰를사용하여간단한웹브라우저기능을구현한다. 매니패스트파일의설정법을배운다. 2 확인해볼까? 3 날짜 / 시간위젯 1) 활동하기 활동개요 [ 그림 9-1] 시간예약앱 활동과정 - 2 - [ 그림 9-2] 안드로이드 SDK Manager [ 예제 9-1]main.xml 1
More informationMicrosoft PowerPoint - 04-UDP Programming.ppt
Chapter 4. UDP Dongwon Jeong djeong@kunsan.ac.kr http://ist.kunsan.ac.kr/ Dept. of Informatics & Statistics 목차 UDP 1 1 UDP 개념 자바 UDP 프로그램작성 클라이언트와서버모두 DatagramSocket 클래스로생성 상호간통신은 DatagramPacket 클래스를이용하여
More informationPowerPoint 프레젠테이션
@ Lesson 3 if, if else, if else if, switch case for, while, do while break, continue : System.in, args, JOptionPane for (,, ) @ vs. logic data method variable Data Data Flow (Type), ( ) @ Member field
More informationREMON Android SDK GUIDE (SDK Version 1.4.1) 1 / 25
REMON Android SDK GUIDE (SDK Version 1.4.1) 1 / 25 문서개정내역 변경일버전변경내용비고 2014.06.30 1.0.0 최초작성 2014.09.30 1.1.0 개인정보항목변경, 개인정보이용약관기능추가 2014.12.01 1.2.0 Proguard 추가 2014.12.16 1.2.0 Android Studio 기준샘플및가이드추가
More informationMicrosoft PowerPoint App Fundamentals[Part2].pptx
To be an Android Expert 문양세강원대학교 IT 대학컴퓨터학부 애플리케이션기초 Part 1 애플리케이션컴포넌트 액티비티와태스크 프로세스와쓰레드 컴포넌트생명주기 Part 2 2 태스크는명시적으로정의 / 선언하는것이아니라, 주어진목적을위해 현재수행되고있는액티비티들의스택이다. 예를들어, 어떤액티비티가특정위치상의시가지지도를보여주고자한다하자. 해당액티비티는안드로이드에이미존재하는맵뷰어액티비티를실행
More information01-OOPConcepts(2).PDF
Object-Oriented Programming Concepts Tel: 02-824-5768 E-mail: hhcho@selabsoongsilackr? OOP (Object) (Encapsulation) (Message) (Class) (Inheritance) (Polymorphism) (Abstract Class) (Interface) 2 1 + = (Dependency)
More informationmytalk
한국정보보호학회소프트웨어보안연구회 총괄책임자 취약점분석팀 안준선 ( 항공대 ) 도경구 ( 한양대 ) 도구개발팀도경구 ( 한양대 ) 시큐어코딩팀 오세만 ( 동국대 ) 전체적인 그림 IL Rules Flowgraph Generator Flowgraph Analyzer 흐름그래프 생성기 흐름그래프 분석기 O parser 중간언어 O 파서 RDL
More information안드로이드 서비스
Android Service Team 4 20100031 강혜주 20100220 김소라 20100357 김진용 Contents Android Service 01 안드로이드서비스 02 사용이유 03 안드로이드서비스예 04 안드로이드서비스분류 Application Service 05 애플리케이션서비스 06 두가지방법 07 서비스생명주기 08 애플리케이션서비스분류
More informationSMART ZONE CAST ANDROID SDK 적용가이드 NIT
SMART ZONE CAST ANDROID SDK 적용가이드 NIT I. 준비 1. Smart Zone Cast Agent( 이하 CBSAgent) 를통해메시지를수신하기위해서는다음과같은 Android 개발환경이필요합니다. OS: Android 4.4(KitKat) 이상 Target SDK Level: 26 이상 Compile SDK Level: 26이상 Java
More informationch09
9 Chapter CHAPTER GOALS B I G J A V A 436 CHAPTER CONTENTS 9.1 436 Syntax 9.1 441 Syntax 9.2 442 Common Error 9.1 442 9.2 443 Syntax 9.3 445 Advanced Topic 9.1 445 9.3 446 9.4 448 Syntax 9.4 454 Advanced
More information05-class.key
5 : 2 (method) (public) (private) (interface) 5.1 (Method), (public method) (private method) (constructor), 3 4 5.2 (client). (receiver)., System.out.println("Hello"); (client object) (receiver object)
More informationConnection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET
135-080 679-4 13 02-3430-1200 1 2 11 2 12 2 2 8 21 Connection 8 22 UniSQLConnection 8 23 8 24 / / 9 3 UniSQL 11 31 OID 11 311 11 312 14 313 16 314 17 32 SET 19 321 20 322 23 323 24 33 GLO 26 331 GLO 26
More information@OneToOne(cascade = = "addr_id") private Addr addr; public Emp(String ename, Addr addr) { this.ename = ename; this.a
1 대 1 단방향, 주테이블에외래키실습 http://ojcedu.com, http://ojc.asia STS -> Spring Stater Project name : onetoone-1 SQL : JPA, MySQL 선택 http://ojc.asia/bbs/board.php?bo_table=lecspring&wr_id=524 ( 마리아 DB 설치는위 URL
More information리니어레이아웃 - 2 -
4 차시레이아웃 1 학습목표 레이아웃의개념을이해한다. 중복리니어레이아웃의개념이해한다. 2 확인해볼까? 3 레이아웃개념익히기 1) 학습하기 [ 그림 4-1] ViewGroup 클래스계층도 리니어레이아웃 - 2 - [ 예제 4-1]orientation 속성-horizontal 1
More informationChap12
12 12Java RMI 121 RMI 2 121 RMI 3 - RMI, CORBA 121 RMI RMI RMI (remote object) 4 - ( ) UnicastRemoteObject, 121 RMI 5 class A - class B - ( ) class A a() class Bb() 121 RMI 6 RMI / 121 RMI RMI 1 2 ( 7)
More information슬라이드 1
안드로이드데이터베이스프로그 래밍 (2) 강대기동서대학교컴퓨터정보공학부 학습목표 데이터바인딩을통해데이터소스에해당하는데이터베이스와뷰에해당하는액티비티를엯결핚데이터베이스응용프로그램을작성핛수있다. 안드로이드내의다른어플리케이션의데이터에접근하기위해제공되는 ContentProvider 를사용핛수있다. 자싞의어플리케이션에서다른어플리케이션으로의데이터제공을위핚 ContentProvider
More information50_1953.pdf
C h a p t e r 02 194 Part Mobile Apps 01 01 02 Chapter 02 195 03 04 196 Part 02 01 02 03 04 Chapter 02 197 05 06 07 08 198 Part 03 01 02 Chapter 02 199 03 04 05 06 200 Part 07 08 09 10 Chapter 02 201 04
More information보가태그다. 태그정보를뮤직플레이어에서활용해곡명과가수정보를출력하는것이다. 안드로이드뮤직플레이어도태그정보를활용한다. 태그정보는문자열로, 글자깨짐현상은글자의인코딩과디코딩의문제로보인다. 따라서원인은다음과같이 2가지로분석할수있다. MP3 파일에서인코딩설정이잘못됨. 안드로이드플랫
5 안드로이드뮤직플레이어 Intent 를활용한 ID3 태그에디터구현안드로이드뮤직플레이어분석 스마트폰에서뮤직플레이어를사용하면서노래제목과가수를안내하는글이깨져보인경험이있는가? 필자는 MP3 의메타정보인 ID3 태그를편집할수있는에디터를만들어이같은사용자의불편을개선하는애플리케이션을배포하고있다. 이번호를통해독자여러분과안드로이드내장뮤직플레이어를분석하고재생중에자동으로음악의정보를찾을수있는기술적인방법을찾아보고자한다.
More information09-interface.key
9 Database insert(record r): boolean find(key k): Record 1 Record getkey(): Key * Record Key Database.? Key equals(key y): boolean Database insert(record r): boolean find(key k): Record * Database OK 1
More informationOOP 소개
OOP : @madvirus, : madvirus@madvirus.net : @madvirus : madvirus@madvirus.net ) ) ) 7, 3, JSP 2 ? 3 case R.id.txt_all: switch (menu_type) { case GROUP_ALL: showrecommend("month"); case GROUP_MY: type =
More informationMicrosoft PowerPoint - 4주차_Android_UI구현.ppt [호환 모드]
Android UI 구현 학습목표 교육목표 Android application 구성요소 Activity Layout UI 설계 Linear Layout 구현 Android application 구성요소 (1) () Application 구성요소 AndroidManifest.xml Android application 구성요소 (2) 구성요소 기능 Activity
More information슬라이드 1
13 장. 커스텀뷰개발 API 에서제공하는뷰를그대로이용하면서약간변형시킨뷰 여러뷰를합쳐서한번에출력하기위한뷰 기존 API 에전혀존재하지않는뷰 public class MyView extends TextView { public class MyView extends ViewGroup { public class MyView extends View { 커스텀뷰를레이아웃
More information3ÆÄÆ®-11
Chapter 11 Chapter 12 Chapter 13 Chapter 14 Chapter 15 Chapter 16 Chapter 17 C # N e t w o r k P r o g r a m m i n g Part 3 _ chapter 11 ICMP >>> 430 Chapter 11 _ 1 431 Part 3 _ 432 Chapter 11 _ N o t
More information위젯과레이아웃위젯은 View 클래스를상속해화면디스플레이와이벤트처리를할수있도록구현된스크린구성의최소단위를말한다. android.widget 패키지에는여러유형의위젯들이포함되어있다. TextView, ImageView, Button, ImageButton 등은가장간단한위젯들이
구글안드로이드프로그래밍 GUI 설계, 위젯과레이아웃 QVGA급컬러 LCD 가대세가되어버린최근의휴대폰환경에서는 GUI 도모바일애플리케이션개발의매우중요한요소로자리잡았다. 이번달에는안드로이드플랫폼의 GUI 프레임워크를살펴보도록하자. 5 연재순서 1 회 2008. 1 애플리케이션구조분석 2 회 2008. 2 GUI 설계, 위젯과레이아웃 3 회 2008. 3 액티비티와인텐트,
More information헬로, 안드로이드 11 주차 위치파악하기와감지하기 강대기동서대학교컴퓨터정보공학부
헬로, 안드로이드 11 주차 위치파악하기와감지하기 강대기동서대학교컴퓨터정보공학부 학습목표 GPS 장치를통해위치를인식하는방법에대해서알아본다. 가속도계에대해서알아본다. 지도를나타내는맵뷰에대해알아본다. 웹뷰와맵뷰를결합함으로써, 여러서비스들을결합하는매시업 (mashup) 에대해알아본다. 차례 위치, 위치, 위치 센서를최대로설정하기 조감도 웹뷰와맵뷰 요약 퀴즈 연습문제
More information자바GUI실전프로그래밍2_장대원.PDF
JAVA GUI - 2 JSTORM http://wwwjstormpekr JAVA GUI - 2 Issued by: < > Document Information Document title: JAVA GUI - 2 Document file name: Revision number: Issued by: Issue Date:
More information목차 INDEX JSON? - JSON 개요 - JSONObject - JSONArray 서울시공공데이터 API 살펴보기 - 요청인자살펴보기 - Result Code - 출력값 HttpClient - HttpHelper 클래스작성 - JSONParser 클래스작성 공공
메신저의새로운혁신 채팅로봇 챗봇 (Chatbot) 입문하기 소 이 메 속 : 시엠아이코리아 름 : 임채문 일 : soulgx@naver.com 1 목차 INDEX JSON? - JSON 개요 - JSONObject - JSONArray 서울시공공데이터 API 살펴보기 - 요청인자살펴보기 - Result Code - 출력값 HttpClient - HttpHelper
More information자바 프로그래밍
5 (kkman@mail.sangji.ac.kr) (Class), (template) (Object) public, final, abstract [modifier] class ClassName { // // (, ) Class Circle { int radius, color ; int x, y ; float getarea() { return 3.14159
More informationExt JS À¥¾ÖÇø®ÄÉÀ̼ǰ³¹ß-³¹Àå.PDF
CHAPTER 2 (interaction) Ext JS., HTML, onready, MessageBox get.. Ext JS HTML CSS Ext JS.1. Ext JS. Ext.Msg: : Ext Ext.get: DOM 22 CHAPTER 2 (config). Ext JS.... var test = new TestFunction( 'three', 'fixed',
More information이것은리스트뷰의 setadapter 메소드에잘표현되어있습니다. setadapter 는리스트뷰에사용할데이터객체를넘겨주는메소드입니다. 일반적으로생각한다면 ArrayAdapter 객체를생성하여사용할데이터를저장할것이고데이터가저장된 ArrayAdapter 객체를 setadapt
1. 리스트뷰의구조 리스트뷰는어떤데이터그룹에대한각각의정보들을항목별로출력시키고사용자에게원하는항목을검색하거나선택할수있도록해주는컨트롤객체입니다. 그래서다른컨트롤처럼정해진형태의정보를저장하는것이아니기때문에리스트뷰가데이터를직접관리하기는힘들었을것입니다. 그래서효과적인데이터관리를위해 "ArrayAdapter" 라는클래스가추가되었고리스트뷰는이클래스를이용해서사용자가지정한데이터에접근하도록구현되어있습니다.
More information쉽게 풀어쓴 C 프로그래밊
Power Java 제 27 장데이터베이스 프로그래밍 이번장에서학습할내용 자바와데이터베이스 데이터베이스의기초 SQL JDBC 를이용한프로그래밍 변경가능한결과집합 자바를통하여데이터베이스를사용하는방법을학습합니다. 자바와데이터베이스 JDBC(Java Database Connectivity) 는자바 API 의하나로서데이터베이스에연결하여서데이터베이스안의데이터에대하여검색하고데이터를변경할수있게한다.
More informationModern Javascript
ES6 - Arrow Function Class Template String Destructuring Default, Rest, Spread let, const for..of Promises Module System Map, Set * Generator * Symbol * * https://babeljs.io/ Babel is a JavaScript compiler.
More information자바로
! from Yongwoo s Park ZIP,,,,,,,??!?, 1, 1 1, 1 (Snow Ball), /,, 5,,,, 3, 3, 5, 7,,,,,,! ,, ZIP, ZIP, images/logojpg : images/imageszip :, backgroundjpg, shadowgif, fallgif, ballgif, sf1gif, sf2gif, sf3gif,
More informationMapView
http://lomohome.com/316 by Geunwon,Mo (mokorean@gmail.com) Android 의 MapView (Google API) 정리하기. 원래하나은행스마트폰뱅킹의위치기반 (LBS) 지점찾기는 WebView 에서 Google Map API 를통하여구현이되어있었다. 아이폰에서는이게잘돌아가는데... 안드로이드에서는기계마다되는것도있고,
More informationMasoJava4_Dongbin.PDF
JSTORM http://wwwjstormpekr Issued by: < > Revision: Document Information Document title: Document file name: MasoJava4_Dongbindoc Revision number: Issued by: < > SI, dbin@handysoftcokr
More information2파트-07
CHAPTER 07 Ajax ( ) (Silverlight) Ajax RIA(Rich Internet Application) Firefox 4 Ajax MVC Ajax ActionResult Ajax jquery Ajax HTML (Partial View) 7 3 GetOrganized Ajax GetOrganized Ajax HTTP POST 154 CHAPTER
More information목차 BUG DEQUEUE 의 WAIT TIME 이 1 초미만인경우, 설정한시간만큼대기하지않는문제가있습니다... 3 BUG [qp-select-pvo] group by 표현식에있는컬럼을참조하는집합연산이존재하지않으면결괏값오류가발생할수있습니다... 4
ALTIBASE HDB 6.5.1.5.10 Patch Notes 목차 BUG-46183 DEQUEUE 의 WAIT TIME 이 1 초미만인경우, 설정한시간만큼대기하지않는문제가있습니다... 3 BUG-46249 [qp-select-pvo] group by 표현식에있는컬럼을참조하는집합연산이존재하지않으면결괏값오류가발생할수있습니다... 4 BUG-46266 [sm]
More informationFileMaker ODBC and JDBC Guide
FileMaker 14 5 5 5 5 6 6 6 7 7 7 8 8 8 9 9 10 10 11 11 12 12 12 12 12 13 13 14 15 16 17 18 18 19 19 20 20 20 21 21 21 22 22 22 22 23 24 24 24 24 25 27 27 28 29 29 29 29 30 30 31 31 31 32 1 1 1 1 1 1 1
More informationMicrosoft PowerPoint UI-Event.Notification(1.5h).pptx
To be an Android Expert 문양세강원대학교 IT 대학컴퓨터학부 UI 이벤트 Event listener Touch mode Focus handling Notification Basic toast notification Customized toast notification Status bar notification 2 사용자가인터랙션하는특정 View
More informationPolly_with_Serverless_HOL_hyouk
{ } "Version":"2012-10-17", "Statement":[ { "Effect":"Allow", "Action":[ "polly:synthesizespeech", "dynamodb:query", "dynamodb:scan", "dynamodb:putitem", "dynamodb:updateitem", "sns:publish", "s3:putobject",
More information5장.key
JAVA Programming 1 (inheritance) 2!,!! 4 3 4!!!! 5 public class Person {... public class Student extends Person { // Person Student... public class StudentWorker extends Student { // Student StudentWorker...!
More information교육2 ? 그림
Interstage 5 Apworks EJB Application Internet Revision History Edition Date Author Reviewed by Remarks 1 2002/10/11 2 2003/05/19 3 2003/06/18 EJB 4 2003/09/25 Apworks5.1 [ Stateless Session Bean ] ApworksJava,
More informationSpring Data JPA Many To Many 양방향 관계 예제
Spring Data JPA Many To Many 양방향관계예제 오라클자바커뮤니티 (ojc.asia, ojcedu.com) 엔티티매핑 (Entity Mapping) M : N 연관관계 사원 (Sawon), 취미 (Hobby) 는다 : 다관계이다. 사원은여러취미를가질수있고, 하나의취미역시여러사원에할당될수있기때문이다. 보통관계형 DB 에서는다 : 다관계는 1
More informationPowerPoint 프레젠테이션
@ Lesson 1,..... @ 1 Green Project 1991 Oak Java 1995. 5 December '90 by Patrick Naughton, Mike Sheridan and James Gosling Embedded in various consumer electronic device 1992. 9. 3 Star 7 1993 www portability
More informationTable of Contents 1. 분석 정보 i. 분석 대상 ii. 분석 환경 2. 동적 분석 3. 정적 분석 4. 결론 5. 치료 방법 Android-Trojan/FakeInst 악성코드 분석 보고서 Page 2 / 13
Android-Trojan/FakeInst 악성코드 분석 보고서 Written by extr (white-hacker@nate.com, http://extr.kr) 2013. 03. 07 Android-Trojan/FakeInst 악성코드 분석 보고서 Page 1 / 13 Table of Contents 1. 분석 정보 i. 분석 대상 ii. 분석 환경 2.
More informationSpring Boot/JDBC JdbcTemplate/CRUD 예제
Spring Boot/JDBC JdbcTemplate/CRUD 예제 오라클자바커뮤니티 (ojc.asia, ojcedu.com) Spring Boot, Gradle 과오픈소스인 MariaDB 를이용해서 EMP 테이블을만들고 JdbcTemplate, SimpleJdbcTemplate 을이용하여 CRUD 기능을구현해보자. 마리아 DB 설치는다음 URL 에서확인하자.
More information11 템플릿적용 - Java Program Performance Tuning (김명호기술이사)
Java Program Performance Tuning ( ) n (Primes0) static List primes(int n) { List primes = new ArrayList(n); outer: for (int candidate = 2; n > 0; candidate++) { Iterator iter = primes.iterator(); while
More information..........(......).hwp
START START 질문을 통해 우선순위를 결정 의사결정자가 질문에 답함 모형데이터 입력 목표계획법 자료 목표계획법 모형에 의한 해의 도출과 득실/확률 분석 END 목표계획법 산출결과 결과를 의사 결정자에게 제공 의사결정자가 결과를 검토하여 만족여부를 대답 의사결정자에게 만족하는가? Yes END No 목표계획법 수정 자료 개선을 위한 선택의 여지가 있는지
More informationMicrosoft PowerPoint - Supplement-03-TCP Programming.ppt [호환 모드]
- Socket Programming in Java - 목차 소켓소개 자바에서의 TCP 프로그램작성방법 주요클래스와메소드 HTTP 프로토콜을이용한예제 에코프로그램 Q/A 에코프로그램 - EchoServer 에코프로그램 - EchoClient TCP Programming 1 소켓소개 IP, Port, and Socket 포트 (Port): 전송계층에서통신을수행하는응용프로그램을찾기위한주소
More informationMicrosoft PowerPoint - 03-TCP Programming.ppt
Chapter 3. - Socket in Java - 목차 소켓소개 자바에서의 프로그램작성방법 주요클래스와메소드 HTTP 프로토콜을이용한예제 에코프로그램 에코프로그램 - EchoServer 에코프로그램 - EchoClient Q/A 1 1 소켓소개 IP,, and Socket 포트 (): 전송계층에서통신을수행하는응용프로그램을찾기위한주소 소켓 (Socket):
More information13주-14주proc.PDF
12 : Pro*C/C++ 1 2 Embeded SQL 3 PRO *C 31 C/C++ PRO *C NOT! NOT AND && AND OR OR EQUAL == = SQL,,, Embeded SQL SQL 32 Pro*C C SQL Pro*C C, C Pro*C, C C 321, C char : char[n] : n int, short, long : float
More information기술문서 작성 XXE Attacks 작성자 : 인천대학교 OneScore 김영성 I. 소개 2 II. 본문 2 가. XML external entities 2 나. XXE Attack 3 다. 점검방법 3 라.
기술문서 14. 11. 10. 작성 XXE Attacks 작성자 : 인천대학교 OneScore 김영성 dokymania@naver.com I. 소개 2 II. 본문 2 가. XML external entities 2 나. XXE Attack 3 다. 점검방법 3 라. Exploit 5 마. 피해 6 III. 결론 6 가. 권고사항 6 I. 소개 가. 역자 본문서는
More informationDocsPin_Korean.pages
Unity Localize Script Service, Page 1 Unity Localize Script Service Introduction Application Game. Unity. Google Drive Unity.. Application Game. -? ( ) -? -?.. 준비사항 Google Drive. Google Drive.,.. - Google
More informationSKT SmartZoneCast Agent 개발자 적용가이드_180116
[SKT Smart Zone Cast ] Android SDK 적용가이드 [2018. 01.16] 준비사항 1. [SKT Smart Zone Cast ] Agent 를통해컨탠츠를수신하기위해서는다음과같은 Android 개발환경이필요합니다. OS : Android 4.4(KitKat) 이상 API Level : 23 이상 Java version: JDK 1.7
More information07 자바의 다양한 클래스.key
[ 07 ] . java.lang Object, Math, String, StringBuffer Byte, Short, Integer, Long, Float, Double, Boolean, Character. java.util Random, StringTokenizer Calendar, GregorianCalendar, Date. Collection, List,
More informationuntitled
- -, (insert) (delete) - - (insert) (delete) (top ) - - (insert) (rear) (delete) (front) A A B top A B C top push(a) push(b) push(c) A B top pop() top A B D push(d) top #define MAX_STACK_SIZE 100 int
More informationilist.add(new Integer(1))과 같이 사용하지 않고 ilist.add(1)과 같이 사용한 것은 자바 5.0에 추가된 기본 자료형과 해당 객체 자료 형과의 오토박싱/언박싱 기능을 사용한 것으로 오토박싱이란 자바 컴파일러가 객체를 요구하는 곳에 기본 자료형
바에 제네릭스(generics)를 도입하기 위한 연구는 이미 8년 전인 1996년부터라고 한다. 실제로 자바에 제네릭스를 도입하 는 몇 가지 방안들이 논문으로 나오기 시작한 것이 1998년 초임을 감 안하면 무려 8년이 지난 후에야 자바 5.0에 전격 채택되었다는 것은 이것이 얼마나 어려운 일이었나 하는 것을 보여준다. 자바의 스펙을 결정하는 표준화 절차인
More informationI T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r
I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r Jakarta is a Project of the Apache
More informationNoSQL
MongoDB Daum Communications NoSQL Using Java Java VM, GC Low Scalability Using C Write speed Auto Sharding High Scalability Using Erlang Read/Update MapReduce R/U MR Cassandra Good Very Good MongoDB Good
More information