[Android] SeekBar ♪ programming

public class homeNetActivity extends Activity {
private SeekBar seekbarControl;
    /-* Called when the activity is first created. *-
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.homenet);
        
        setRequestedOrientation( ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        
        seekbarControl = (SeekBar) this.findViewById(R.id.sbLight);
        
        seekbarControl.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
@Override
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {
Toast.makeText( homeNetActivity.this, "onProgressChanged", Toast.LENGTH_SHORT).show() ;   
                                  //값이 변경될대 변경된 값이 progress에 들어온다.                             
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
Toast.makeText( homeNetActivity.this, "onStartTrackingTouch", Toast.LENGTH_SHORT).show() ; //SeekBar를 이동하기 위하여 선택하였을때
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
Toast.makeText( homeNetActivity.this, "onStopTrackingTouch", Toast.LENGTH_SHORT).show() ; //SeekBar를 이동하다가 멈추었을때
}
        
        });
    }
}

좀더 자세히 : android 사이트

[Android] ProgressBar ♪ programming





/-
 * Copyright (C) 2007 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-

package com.example.android.apis.view;

import com.example.android.apis.R;

import android.app.Activity;
import android.widget.Button;
import android.widget.ProgressBar;
import android.os.Bundle;
import android.view.View;
import android.view.Window;


/-*
 * Demonstrates how to use progress bars as widgets and in the title bar.  The progress bar
 * in the title will be shown until the progress is complete, at which point it fades away.
 *-
public class ProgressBar1 extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Request the progress bar to be shown in the title
        requestWindowFeature(Window.FEATURE_PROGRESS);
        setContentView(R.layout.progressbar_1);
        setProgressBarVisibility(true);
       
        final ProgressBar progressHorizontal = (ProgressBar) findViewById(R.id.progress_horizontal);
        setProgress(progressHorizontal.getProgress() * 100);
        setSecondaryProgress(progressHorizontal.getSecondaryProgress() * 100);
       
        Button button = (Button) findViewById(R.id.increase);
        button.setOnClickListener(new Button.OnClickListener() {
            public void onClick(View v) {
                progressHorizontal.incrementProgressBy(1);
                // Title progress is in range 0..10000
                setProgress(100 * progressHorizontal.getProgress());
            }
        });

        button = (Button) findViewById(R.id.decrease);
        button.setOnClickListener(new Button.OnClickListener() {
            public void onClick(View v) {
                progressHorizontal.incrementProgressBy(-1);
                // Title progress is in range 0..10000
                setProgress(100 * progressHorizontal.getProgress());
            }
        });

        button = (Button) findViewById(R.id.increase_secondary);
        button.setOnClickListener(new Button.OnClickListener() {
            public void onClick(View v) {
                progressHorizontal.incrementSecondaryProgressBy(1);
                // Title progress is in range 0..10000
                setSecondaryProgress(100 * progressHorizontal.getSecondaryProgress());
            }
        });

        button = (Button) findViewById(R.id.decrease_secondary);
        button.setOnClickListener(new Button.OnClickListener() {
            public void onClick(View v) {
                progressHorizontal.incrementSecondaryProgressBy(-1);
                // Title progress is in range 0..10000
                setSecondaryProgress(100 * progressHorizontal.getSecondaryProgress());
            }
        });
       
    }
}


원본 : http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ProgressBar1.html


[Android] System Service ♪ programming


안드로이드 시스템 서비스
 - 시스템의 가장 기본적인 핵심기능 제공
 - 부팅시 init 프로세서에 의해 실행된다.
     : 부팅시 미디어 서버와 시스템 서버 두개로 실행
       +Media Server 
             : C++ 네이티브 서비스
             : Audio Flinger, Media Player Service, Camera Service , Audio Policy Service
       +System Server 
              : Zygote에 의해 맨 처음 생성되는 자바 기반의 네이티브 시스템 서비스
              : Surface Flinger, Java System Service

시스템 서비스 분류
 - 네이티브 시스템 서비스
    : C++ 로 작성  라이브 레이어에서 동작

   *Audio Finger 서비스


정리 작성중....

[Android] Android Service ♪ programming


안드로이드 서비스
 -startService() : 서비스 시작 /종료
 -bindService() :  서비스 원격 제어

서비스 종류
 -로컬 서비스 : 생성된 서비스가 자신과 동일한 프로세스에서 실행되는 경우 
                      애플리케이션내에서만 사용 그래서 애플리케이션 종료시 같이 종료                   
  
 - 리모트 서비스 : 자신이 생성한 액티비티와는 별개의 독립적인 프로세서위에서 동작
                          메인 애플리케이션이 종료 하여도 계속 실행
                          애플리케이션에서 리모트 서비스를 제어하려면 리모트 서비스 바인딩을 해야함
   *IPC통신 
     -AIDL 사용



작성하기
 - 로컬 서비스 
     예제 참조

 - 리모트 서비스
     * androidMainfest.xml
             intent 추가 

서비스 예제 
 

참고 :  



건강하게 살기 ♪ ...etc

1. 우울증 없애기
 망상하지말것 / 분노 인정

2. 술 줄이기

3. 등 통증 예방
  자세 바로 모니터 의자 키높이 맞추기
  충분한 수면

4. 스트레스 줄이기

5. 건강 검진

7. 콜레스테롤 수치 낮추기
   - 땅콩 / 호도

8. 깨끗한 환경
   - 면역력 키우기
   -운동 / 홍삼

9. 잠자리에선 잠만 자기

10. 암 발생율 줄이기
  - 해빛 맣이 받기
  - 과일 / 야책 많이 먹기

무조건 운동해야겠다 ㅋㅋ

발췌 :  http://cafe.daum.net/gy8972/2iZo/568?docid=xSeG|2iZo|568|20090415071619&q=%B4%AB%20%B0%C7%B0%AD%20%BF%CF%C0%FC%C1%A4%BA%B9
  


1 2 3 4 5 6 7 8 9 10 다음