'잡다한것들전부/안드로이드'에 해당되는 글 15건
- 2014.12.02 화웨이 단말기에서 로그캣이 안나오는 현상.
- 2014.11.25 MySQL SQLite 회원가입 및 로그인 설명
- 2014.08.08 안드로이드 baas.io
- 2014.08.07 안드로이드 gcm 관련 php 통신.
- 2014.08.05 안드로이드 유효성 검사하기 AsyncTask..
- 2014.01.13 애플리케이션 오류
- 2014.01.13 구글 인앱 빌링 ver 3 item already owned 오류시 해결방법
- 2014.01.13 구글 안드로이드 인앱결제 관련 인앱빌링 ver3 적용
- 2014.01.07 adb 패스 설정
- 2014.01.06 안드로이드 동적 생성 view button progressbar 등
화웨이 단말기에서 로그캣이 안나옴 -> Log.d , Log.v 만 안나옴
- dial *#*#2846579#*#*
- select 'ProjectMenu'
- select 'Background Setting'
- select 'Log Setting'
- select 'Log Switch'
- enable 'LOG on'
- Select 'Log level setting'
- enable 'DEBUG'
- Press the 'Back' key
- select 'Dump and Log'
- enable 'Open Dump and Log'
- Press 'Back' key 5 times to return to home screen.
- Reboot the phone.
- LogCat should now work.
Dial this: *#*#2846579#*#*
Service menu will appear.
Go to "ProjectMenu" -> "Background Setting" -> "Log Setting"
Open "Log switch" and set it to ON.
Open "Log level setting" and set the log level you wish.
'잡다한것들전부 > 안드로이드' 카테고리의 다른 글
| 화웨이 단말기에서 로그캣이 안나오는 현상. (0) | 2014.12.02 |
|---|---|
| MySQL SQLite 회원가입 및 로그인 설명 (0) | 2014.11.25 |
| 안드로이드 baas.io (0) | 2014.08.08 |
| 안드로이드 gcm 관련 php 통신. (0) | 2014.08.07 |
| 안드로이드 유효성 검사하기 AsyncTask.. (0) | 2014.08.05 |
| 애플리케이션 오류 (0) | 2014.01.13 |
http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/
'잡다한것들전부 > 안드로이드' 카테고리의 다른 글
| 화웨이 단말기에서 로그캣이 안나오는 현상. (0) | 2014.12.02 |
|---|---|
| MySQL SQLite 회원가입 및 로그인 설명 (0) | 2014.11.25 |
| 안드로이드 baas.io (0) | 2014.08.08 |
| 안드로이드 gcm 관련 php 통신. (0) | 2014.08.07 |
| 안드로이드 유효성 검사하기 AsyncTask.. (0) | 2014.08.05 |
| 애플리케이션 오류 (0) | 2014.01.13 |
샘플코드
별건 없고 그냥 onCreate에다가 박아넣음
gcm 안됨. 리시버랑 인텐트를 추가안해서.
권한주고
Application에 있는 내용 다 메인 엑티비티로 이동시키고
onTerminate에 있는 내용은 onDestroy에 이동시킴.
실행하니까 일단은 딤
'잡다한것들전부 > 안드로이드' 카테고리의 다른 글
| 화웨이 단말기에서 로그캣이 안나오는 현상. (0) | 2014.12.02 |
|---|---|
| MySQL SQLite 회원가입 및 로그인 설명 (0) | 2014.11.25 |
| 안드로이드 baas.io (0) | 2014.08.08 |
| 안드로이드 gcm 관련 php 통신. (0) | 2014.08.07 |
| 안드로이드 유효성 검사하기 AsyncTask.. (0) | 2014.08.05 |
| 애플리케이션 오류 (0) | 2014.01.13 |
대강
할건 없고. 오픈소스 프로젝트의 프로젝트대로 소스 복붙하고
자기 자신의 regid 알아낸다음에 아래에 입력해주고
노티피케이션이 실행되는지만 하면 됨.
상용화될 게임에는 regid 등록해주는 부분에서 각 DB 에 regid 등록해주고
아래 php 구문을 DB에 접속해서 DB의 regid 를 모두 호출해주는 식으로 수정해주면 될거같음.
일단 확실히 되는 php 구문임..
<?php
// Replace with real server API key from Google APIs
// 서버api Key 입력
$apiKey = "";
// Replace with real client registration IDs
// 각 핸드폰 기계의 registraitionID 입력.
$registrationIDs = array(
" ",
" ",
);
// Message to be sent
// 입력하고 싶은 메시지 입력
$message = "Test Notificación PHP";
// Set POST variables
$url = 'https://android.googleapis.com/gcm/send';
$fields = array(
'registration_ids' => $registrationIDs,
'data' => array( "message" => $message ),
);
$headers = array(
'Authorization: key=' . $apiKey,
'Content-Type: application/json'
);
// Open connection
$ch = curl_init();
// Set the url, number of POST vars, POST data
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode( $fields ));
// Execute post
$result = curl_exec($ch);
// Close connection
curl_close($ch);
echo $result;
?>
'잡다한것들전부 > 안드로이드' 카테고리의 다른 글
| MySQL SQLite 회원가입 및 로그인 설명 (0) | 2014.11.25 |
|---|---|
| 안드로이드 baas.io (0) | 2014.08.08 |
| 안드로이드 gcm 관련 php 통신. (0) | 2014.08.07 |
| 안드로이드 유효성 검사하기 AsyncTask.. (0) | 2014.08.05 |
| 애플리케이션 오류 (0) | 2014.01.13 |
| 구글 인앱 빌링 ver 3 item already owned 오류시 해결방법 (0) | 2014.01.13 |
일단 대강 이런식으로 처리 해주면 될거같음..
IabHelper.OnIabPurchaseFinishedListener mPurchaseFinishedListener = new IabHelper.OnIabPurchaseFinishedListener() {
public void onIabPurchaseFinished(IabResult result, Purchase purchase) {
.
.
.
verifyPayloadTask task = new verifyPayloadTask();
task.execute(purchase);
}
}
class verifyPayloadTask extends AsyncTask<Purchase, Void, Void> {
boolean isVerify = false;
Purchase purchase;
@Override
protected Void doInBackground(Purchase... params) {
// TODO Auto-generated method stub
//오류시 null 반환
Log.d(TAG, "verifypaylaod doinBackground!");
isVerify = true;
purchase = params[0];
return null;
}
protected void onPostExecute(Void voids) {
Log.d(TAG,"verifyPayloadTask onPostExecute");
if(isVerify){
Log.d(TAG, "Purchase successful.");
if (purchase.getSku().equals(SKU_GAS)) {
// bought 1/4 tank of gas. So consume it.
Log.d(TAG, "Purchase is gas. Starting gas consumption.");
mHelper.consumeAsync(purchase, mConsumeFinishedListener);
}
}
}
}
'잡다한것들전부 > 안드로이드' 카테고리의 다른 글
| 안드로이드 baas.io (0) | 2014.08.08 |
|---|---|
| 안드로이드 gcm 관련 php 통신. (0) | 2014.08.07 |
| 안드로이드 유효성 검사하기 AsyncTask.. (0) | 2014.08.05 |
| 애플리케이션 오류 (0) | 2014.01.13 |
| 구글 인앱 빌링 ver 3 item already owned 오류시 해결방법 (0) | 2014.01.13 |
| 구글 안드로이드 인앱결제 관련 인앱빌링 ver3 적용 (0) | 2014.01.13 |
어플리케이션 오류
이 버전의 애플리케이션에서는 Google Play를 통한 결제를 사용 할 수 없습니다. 자세한 내용을 도움말 센터를 참조하세요
먼저 어플을 등록하고 인앱을 등록합니다.
인앱을 등록한후 인앱은 반드시 활성화 apk로 해야되며,
등록한후 2~3시간 이후에 적용이 됩니다.
그리고 인앱결제 테스트를 하기 위해서는 설정에서
테스트 권환이 있는 Gmail 계정에등록한후(이것도 2~3시간 이후에 확인 가능합니다.)
테스트를 하기 위해서는 반드시!!!
Export로 keystore가 적용된 apk파일을 추출하여 핸드폰에 넣어서 테스트를 해야됩니다.
이렇지 않을 시에는 위와 같은 오류가 발생합니다.
'잡다한것들전부 > 안드로이드' 카테고리의 다른 글
| 안드로이드 gcm 관련 php 통신. (0) | 2014.08.07 |
|---|---|
| 안드로이드 유효성 검사하기 AsyncTask.. (0) | 2014.08.05 |
| 애플리케이션 오류 (0) | 2014.01.13 |
| 구글 인앱 빌링 ver 3 item already owned 오류시 해결방법 (0) | 2014.01.13 |
| 구글 안드로이드 인앱결제 관련 인앱빌링 ver3 적용 (0) | 2014.01.13 |
| adb 패스 설정 (0) | 2014.01.07 |
'잡다한것들전부 > 안드로이드' 카테고리의 다른 글
| 안드로이드 유효성 검사하기 AsyncTask.. (0) | 2014.08.05 |
|---|---|
| 애플리케이션 오류 (0) | 2014.01.13 |
| 구글 인앱 빌링 ver 3 item already owned 오류시 해결방법 (0) | 2014.01.13 |
| 구글 안드로이드 인앱결제 관련 인앱빌링 ver3 적용 (0) | 2014.01.13 |
| adb 패스 설정 (0) | 2014.01.07 |
| 안드로이드 동적 생성 view button progressbar 등 (0) | 2014.01.06 |
'잡다한것들전부 > 안드로이드' 카테고리의 다른 글
| 애플리케이션 오류 (0) | 2014.01.13 |
|---|---|
| 구글 인앱 빌링 ver 3 item already owned 오류시 해결방법 (0) | 2014.01.13 |
| 구글 안드로이드 인앱결제 관련 인앱빌링 ver3 적용 (0) | 2014.01.13 |
| adb 패스 설정 (0) | 2014.01.07 |
| 안드로이드 동적 생성 view button progressbar 등 (0) | 2014.01.06 |
| 뒤로가기 버튼 클릭시 종료 팝업후 종료 하기 (0) | 2013.12.30 |
C:\Android\adt-bundle-windows-x86-20130729\adt-bundle-windows-x86-20130729\sdk\platform-tools
ADB(Android Debug Bridge)
http://developer.android.com/tools/help/adb.html
adb 는 Android Debug Bridge 의 약자로 안드로이드 디버그 기능을 한다고 보면 됩니다.
adb를 사용해서 에뮬레이터 및 장치를 이용할 수 있습니다.
adb 명령을 알아보기 위해 우선 adb.exe 가 있는 곳으로 이동합니다.
제가 테스트하는 환경에서 Android SDK 는 아래와 같습니다.
adbshell 에서 쓸수 있는 명령어 모음 입니다.
adb logcat -v time [filter]
시스템 기본정보: 하드웨어, 커널 등
cat /proc/version : 커널 버전
cat /proc/cpuinfo : 프로세서 정보, CPU타입, 모델 제조사 등
cat /porc/meminfo : 메모리 정보, 실제 메모리 및 가상 메모리
cat /proc/devices : 현재 커널에 설정되어 있는 장치 목록
mount : 마운트된 모든 장치 정보
df : 하드디스크 사용량
cat /porc/filesystems : 커널에 설정되어 있는 파일시스템 목록
cat /proc/swaps : 스왑 파티션의 크기와 사용량
cat /proc/interrupts : 장치가 사용중인 인터럽트(IRQ)목록 표시
cat /proc/ioports : 현재 사용중인 input/output 포트
cat /proc/partitions : 파티션 정보
cat /proc/uptime : 시스템이 얼마나 살아있었는지
cat /proc/stat : 시스템 상태에 관한 다양한 정보, CPU 사용 통계, 부팅이후 page fault 발생 횟수 등
cat /proc/zoneinfo : ZONEINFO
dmesg : 시스템 부팅시 나왔던 메시지
ps : 실행중인 프로세스 정보
ps -p - t : 프로세스와 쓰레드 목록
set or printenv : 환경설정값 출력
시스템 리소스 사용 현황
vmstat : 시스템 리소스 상황 모니터, CPU, I/O, Memory 등
cat /proc/diskstats : 디스크 utilization과 throughput. 즉 디스크 I/O현황
top : 시스템 프로세스 상황 모니터링/ 프로세스별 CPU사용량, 메모리와 스왑 사용량 등
procrank : 프로세스별 메모리
dumpsys meminfo [PID] : 해당 프로세스 메모리 상세 정보
cat /proc/[PID]/stat : 해당 프로세스에 대한 정보, 시작시간, 상태, CPU 사용량 등
cat /proc/[PID]/maps : 해당 프로세스의 메모리 맵 정보
cat /proc/vmstat : 버추얼 메모리 통계?
librank : 라이브러리별 메모리 사용량?
네트워크 관련
cat /proc/net/netlink : 네트워크 정보
netcfg : 네트워크 인터페이스와 IP주소 목록
netstat : 네트워크 연결상태 확인
nc : 네트워크용 cat 명령어(netcat)
ifconfig : 네트워크 인터페이스 설정 정보. 장치명을 파라미터로 받음. ip 주소. 서브넷마스크 등
tcpdump : 실시간 패킷 모니터링
iftop : 네트워크를 위한 top
route : 해당 호스트까지 연결하는 중간 경로 정보인 라우팅 테이블 표시
ping : 원격 호스트와의 연결 테스트
cat /proc/net/route : Route
안드로이드 제공
logcat : 로그캣 보기
pm : package manager의 약자. 패키지/permission/instrumentation/feature 목록, 패키지 설치/제거 등
am : activity manager의 약자, 액티비티 시작, Intent 브로드캐스팅, Instrumentation 시작, profiling 시작 / 중지 등
service : 안드로이드 서비스 목록 표시, 서비스에 명령 전달
monkey : 애플리케이션에 랜덤 이벤트 발생시킴. 사용자 이벤트, 시스템 이벤트의 무작위 발행
cat /data/anr/traces.txt : VM TRACES (쓰레드 덤프)
cat /proc/binder/proc/[PID] : 바인더 프로세스 상태
cat /proc/binder/xxx : 바인더 관련 정보(xxx은 transaction, transaction_log, failed_transaction_log, stats 등)
cat /data/system/packages.xml : 설치된 패키지 세팅 정보
setprop : system property 셋팅
getprop : 셋팅된 system property 목록 출력
종합 리포트
dumpsys [service] : app/service 상태정보 덤프, 서비스별로 추가 파라미터 받을 수 있음
dumpstate : device 상태정보 덤프. 상태정보를 추출하는 여러 명령어들의 조합으로 구성
dumpcrash : 애플리케이션이 crach될 때의 상태정보 덤프
bugreport : logcat + dumpsys + dumpstat
---------------------------------------------------------------------------------------------
ADB Shell Command - 15가지 팁
Basic Android Terminal and ADB Shell Command List
1. How to open a cmd in Android Phone
Method 1: “Start” ? “”Program”-” “Accessories” ? “” Command Prompt ”
Method 2: “Start” ? “” Run “, type cmd ENTER
2. How to restart Android Phone
When the phone and Computer is connected to the data cable, you can enter the following command
adb shell reboot === ENTER
3. Restart Android into Recovery Mode
With the data cable connected to your phone and computer, enter the following command
adb shell reboot recovery === ENTER
4. Convert back to ext2 partition
Restart the phone into Recovery mode, press “Alt + X” into the console. Open cmd and enter the following command
adb shell === ENTER
tune2fs-O ^ has_journal / dev/block/mmcblk0p2 === carriage return
e2fsck / dev/block/mmcblk0p2 === carriage return (optional, can be a problem area in section 2, when used)
5. Pulling applications from Android phone to computer
adb pull /system/sd/app app
adb pull /system/sd/app-private app-private
6. Pushing applications back to android phone from the computer
adb push app /system/sd/app
adb push app-private /system/sd/app-private
7. Delete existing apps on Android SD
adb shell rm -r /system/sd/app
adb shell rm -r /system/sd/app-private
8. Repair gravity System or switch to screen
Sometimes frequent brushing of phone can cause gravity system or switch to screen failure. Just follow the steps below-
Restart the phone into Recovery mode, press “Alt + X” into the console
Open cmd and enter the following command
mount / data === carriage return
rm / data / misc / akmd * / data / misc / rild * === ENTER
9. Ext2/ext3/ext4 formatted partition
Enter the following command in the cmd
adb remount === ENTER
adb shell === ENTER
rm-r / system / sd / * === carriage return
10. Remove/ system / app under the application
Under normal circumstances / system / app is not under an application. Use the following methods to remove these applications.
Open cmd and enter the following command
adb remount === ENTER
adb rm / system / app / Stocks.apk === Enter
11. If the start Time is too Long
Just enter the following command in order to view the boot process.
adb logcat === ENTER
12. Through Terminal Partition SD card
It will erase everything on your SD card
$ su
# cd /data
# wget http://64.105.21.209/bin/lib/droid/sdsplit
# chmod 555 sdsplit
# /data/sdsplit -fs *size* (add -nc to the end for JFv1.5ADP)
13. From the Recovery Screen, send an update file to your SD card.
adb shell mount /sdcard
adb shell rm /sdcard/update.zip
adb push *filename* /sdcard/update.zip
14. Restoring a nandroid backup via Fastboot
Start command-prompt/terminal cd to the nandroid folder and enter following commands
fastboot erase boot
fastboot erase recovery
fastboot flash system system.img
fastboot flash boot boot.img
fastboot flash userdata data.img
fastboot flash recovery recovery.img
fastboot reboot
15. Clear Search History in Android
Search History is accounted for Mobile Memory. It can also leak your privacy information as well. Just follow the steps below to clear android history.
Steps are as follows:
1. Make sure your mobile phone has Root authority.
2. Open the super-terminal.
3. Enter the following command
su
rm / data / data / com.android.vending / databases / suggestions.db
4. Exit Hyper Terminal and restart the phone.
---------------------------------------------------------------------------------------------
adb devices
adb 서버가 인식한 휴대폰과 에뮬레이터 목록을 보여준다.
연결된 devices의 TCP/IP 포트 번호를 알아낼 때 도움이 된다.
다른 명령어를 사용할 때, -s나 -e 옵션은 여러 개의 장치를 연결했을 때 특정한 디바이스를 지정할 때 사용한다.
예)
디바이스 검색
adb devices
adb shell
타겟 시스템의 쉘에 연결하고 # 프롬프트를 띄운다. 쉘은 간소한 유닉스 쉘 같아서 간단한 명령으로 타겟 시스템을 탐색하고 수정할 수 있다.
예)
여러 단말기 중에 하나를 선택해서 접속할 때,
adb -s emulator-5554 shell
adb install [-l][-r] file_spec
app을 설치하거나 재설치할 때 사용한다.
-l : 다른 장치로 복사돼 넘어가는 것을 막는다.
-r: 이미 존재하는 app 데이터를 지우지 않은 채 어플리케이션을 재설치 한다.
file_spec: 설치할 app의 .apk 파일
예)
파일 설치시
adb install c:\download\HangulKeyboard.apk
adb uninstall [-k] package
패키지 이름을 가진 app을 제거하다.
-k : app의 데이터를 보존한다.
package: 패키지의 전체 경로, .apk 확장자는 빼야 한다.
예)
패키지 삭제시
adb unstall com.falinux.android.hello
adb push local remote
개발자 컴퓨터에 있는 local이란 이름을 가진 파일을 타겟 시스템에 remote란 이름으로 복사한다.
예)
com.falinux.android.rose.apk 파일을 안드로이드 기기 /data/app/ 폴더 안으로 집어넣을 때,
adb push c:\com.falinux.android.rose.apk /data/app/
adb pull remote local
타겟 시스템에 있는 remote라는 파일을 개발자 컴퓨터에 local이란 이름으로 복사한다.
예)
안드로이드 기기 /data/app/com.falinux.android.rose.apk 파일을 C 드라이브로 가져올 때,
adb pull /data/app/com.falinux.android.rose.apk c:\com.falinux.android.rose.apk
adb reboot
안드로이드 시스템을 리부팅 시킨다.
adb kill-server
adb 에 문제가 있을 경우, adb를 종료시킨다.
adb start-server
종료된 adb를 실행 시킨다.
'잡다한것들전부 > 안드로이드' 카테고리의 다른 글
| 구글 인앱 빌링 ver 3 item already owned 오류시 해결방법 (0) | 2014.01.13 |
|---|---|
| 구글 안드로이드 인앱결제 관련 인앱빌링 ver3 적용 (0) | 2014.01.13 |
| adb 패스 설정 (0) | 2014.01.07 |
| 안드로이드 동적 생성 view button progressbar 등 (0) | 2014.01.06 |
| 뒤로가기 버튼 클릭시 종료 팝업후 종료 하기 (0) | 2013.12.30 |
| INSTALL_FAILED_INSUFFICIENT_STORAGE 오류시 (0) | 2013.12.30 |
package com.activity.test;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
public class StartActivity extends Activity {
Button btn;
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
// FrameLayout Create
ViewGroup.LayoutParams framelayout_params =
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT);
FrameLayout framelayout = new FrameLayout(this);
framelayout.setLayoutParams(framelayout_params);
setContentView(framelayout);
//TextView
TextView textView = new TextView(this);
textView.setText("Text Test");
framelayout.addView(textView);
//button
Button myButton = new Button(this);
myButton.setText("Press Me");
ViewGroup.LayoutParams button_layout_params =
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
myButton.setLayoutParams(button_layout_params);
framelayout.addView(myButton);
//button touch event!
myButton.setOnClickListener(new OnClickListener(){
public void onClick(View v)
{
Intent intent = new Intent(StartActivity.this, ActivityTest.class);
startActivity(intent);
finish();
}
});
//frameLayout addView LinearLayout
ViewGroup.LayoutParams linearLayout_params =
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT);
LinearLayout layout = new LinearLayout(this);
layout.setLayoutParams(linearLayout_params);
layout.setGravity(Gravity.CENTER);
framelayout.addView(layout);
ProgressBar progressBar2 = new ProgressBar(this, null, android.R.attr.progressBarStyleLarge);
ViewGroup.LayoutParams edittext_layout_params =
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
progressBar2.setLayoutParams(edittext_layout_params);
layout.addView(progressBar2);
}
}
'잡다한것들전부 > 안드로이드' 카테고리의 다른 글
| 구글 안드로이드 인앱결제 관련 인앱빌링 ver3 적용 (0) | 2014.01.13 |
|---|---|
| adb 패스 설정 (0) | 2014.01.07 |
| 안드로이드 동적 생성 view button progressbar 등 (0) | 2014.01.06 |
| 뒤로가기 버튼 클릭시 종료 팝업후 종료 하기 (0) | 2013.12.30 |
| INSTALL_FAILED_INSUFFICIENT_STORAGE 오류시 (0) | 2013.12.30 |
| Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE (0) | 2013.12.16 |
baasio.zip




