노무현 대통령 배너

Double-J's World

blog logo image

Double-J's World » Search » Results » Articles

Android와 관련된 글 4개

  1. 2010.02.25 안드로이드폰 메모리에관한 문제점이 대두!! / Double-J
  2. 2010.01.24 Android Developer Labs World Tour 가 시작되는군요 2 / Double-J
  3. 2009.11.05 To create a status bar notification / Double-J
  4. 2009.10.31 Example ProgressDialog with a second thread / Double-J

Double-J's World » Programming/Android

안드로이드폰 메모리에관한 문제점이 대두!!

Double-J | 2010. 2. 25. 10:00

안드로이드폰을 사용하지 않아서 몰랐던 문제였지만
애플리케이션을 기본 메모리에만 저장하도록 하는 문제가 언급되는 기사가 떴네요.
그러면 그전에 인터넷에선 왈가왈부 계속 말이 많았겠군요.. 

개인 핸드폰을 2개를 만드는 한이 있더라도 안드로이드폰은 한번 구입해보고싶었었는데
지금까지 꾹꾹 참아온것이 어찌보면 다행이라고 생각합니다.


역시 1세대로 나오는 기기들은 한번 지켜봐야하는 것일까요?

이번 문제는 구글측에서 안드로이드 플랫폼 자체를 애플리케이션을 받을경우 외장메모리에는 안되게 자체적으로 
이러한 제한을 걸어둔것 같네요.

기사에 언급된 내용을보면 넥서스원도 같은 문제가 있다고하는데.. 이로서 안드로이드 열풍이 주춤하는게 아닌가 싶기도 합니다. (무언가 대책이 나오긴 하겠죠?)

먼저 모토로이 폰을 산 분들의 원망이 참 많을 것 같습니다.







(go to top)

Double-J's World » Programming/Android

Android Developer Labs World Tour 가 시작되는군요

Double-J | 2010. 1. 24. 18:36


초기의 Hardware 를 실험해볼 수 있고, Android 개발자와 직접만나서 여러 얘기를 나눌 수 있는 Android Developer Labs World Tour 가 시작되었습니다.

전세계 개발자가 관심이 쏠리겠죠?

하지만 아쉽게도 우리나라는 line-up 에 없네요..

물론 이게 우리나라에서 된다고 하더라도 각자의 직업상 많은 분들이 참여를 못할 수도있겠지만 파워블로거님들의 후기라도 듣고 싶던 저는 많이 아쉽습니다.

우리나라에서도 Motorola 를 첫 주자로 안드로이드 폰이 나올 것같은데..

KT 측의 얘기로는 안드로이드폰을 공수해서 개인적으로 전파 인증을 받은사람을 개통을 해줬다고 합니다.

아이폰의 위력인지.. KT측에서는 이제 스마트폰에 적극적인 태도를 보이는 것 같습니다.
고객의 니즈를 적극 수용하고 만족시켜야 성공하는 기업으로 발돋움 할 수 있음은 두말하면 잔소리겠지요? :)


아래는 Android Developer Labs World Tour 의 Line-up 입니다.

North America

  • Austin, Texas – Feb 4
  • Seattle, Washington – Feb 8
  • Waterloo, Ontario, Canada – Feb 8
  • Washington, D.C. – Feb 9
  • Mountain View, California – Feb 10
  • Cambridge, Massachusetts – Feb 11
  • New York, New York – Feb 12

Europe

  • London, UK – Feb 2
  • Paris, France – Feb 8
  • Berlin, Germany – Feb 10
  • Zurich, Switzerland – Feb 13
  • Madrid, Spain – Feb 13

Asia

  • Singapore – Feb 28
  • Taipei, Taiwan – March 3
  • Hong Kong – March 4

출처 : http://android-developers.blogspot.com/2010/01/android-developer-labs-world-tour.html




(go to top)

Double-J's World » Programming/Android

To create a status bar notification

Double-J | 2009. 11. 5. 11:02

1. Get a reference to the NotificationManager:
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);


2. Instantiate the Notification:
int icon = R.drawable.notification_icon;
CharSequence tickerText = "Hello";
long when = System.currentTimeMillis();

Notification notification = new Notification(icon, tickerText, when);


3. Define the Notification's expanded message and Intent:
Context context = getApplicationContext();
CharSequence contentTitle = "My notification";
CharSequence contentText = "Hello World!";
Intent notificationIntent = new Intent(this, MyClass.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);

notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);


4. Pass the Notification to the NotificationManager:
private static final int HELLO_ID = 1;

mNotificationManager.notify(HELLO_ID, notification);
User 는 이제 Notification 을 통보 받는다.

출처 : http://developer.android.com/guide/topics/ui/notifiers/notifications.html


(go to top)

Double-J's World » Programming/Android

Example ProgressDialog with a second thread

Double-J | 2009. 10. 31. 11:19

진행 상태를 추적하기 위해 두 번재 thread 를 사용한다.

그 thread 는 진행이 이루어질 때마다 핸들러를 통해서 main activity  에게 message 를 보낸다.

메시지를 받은 activity 는 Progress Dialog 를 update 한다.



package com.example.progressdialog;

import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class NotificationTest extends Activity {
    static final int PROGRESS_DIALOG = 0;
    Button button;
    ProgressThread progressThread;
    ProgressDialog progressDialog;
   
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        // Setup the button that starts the progress dialog
        button = (Button) findViewById(R.id.progressDialog);
        button.setOnClickListener(new OnClickListener(){
            public void onClick(View v) {
                showDialog(PROGRESS_DIALOG);
            }
        }); 
    }
   
    protected Dialog onCreateDialog(int id) {
        switch(id) {
        case PROGRESS_DIALOG:
            progressDialog = new ProgressDialog(NotificationTest.this);
            progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
            progressDialog.setMessage("Loading...");
            progressThread = new ProgressThread(handler);
            progressThread.start();
            return progressDialog;
        default:
            return null;
        }
    }

    // Define the Handler that receives messages from the thread and update the progress
    final Handler handler = new Handler() {
        public void handleMessage(Message msg) {
            int total = msg.getData().getInt("total");
            progressDialog.setProgress(total);
            if (total >= 100){
                dismissDialog(PROGRESS_DIALOG);
                progressThread.setState(ProgressThread.STATE_DONE);
            }
        }
    };

    /** Nested class that performs progress calculations (counting) */
    private class ProgressThread extends Thread {
        Handler mHandler;
        final static int STATE_DONE = 0;
        final static int STATE_RUNNING = 1;
        int mState;
        int total;
       
        ProgressThread(Handler h) {
            mHandler = h;
        }
       
        public void run() {
            mState = STATE_RUNNING;   
            total = 0;
            while (mState == STATE_RUNNING) {
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    Log.e("ERROR", "Thread Interrupted");
                }
                Message msg = mHandler.obtainMessage();
                Bundle b = new Bundle();
                b.putInt("total", total);
                msg.setData(b);
                mHandler.sendMessage(msg);
                total++;
            }
        }
        
        /* sets the current state for the thread,
         * used to stop the thread */
        public void setState(int state) {
            mState = state;
        }
    }
}
출처 : http://developer.android.com/guide/topics/ui/dialogs.html


(go to top)