본문 바로가기

Development/Android

[Android] dimen 다양한 type 정의~! Dimen에 float을 정의하는데 오류가 나서 방법을 찾아봤다. 아래와 같이 사용하면 되며 float을 다른 값으로 바꾸어도 적용이 된다. 어시스트에서 적당한 type을 고르면 된다.~! 0.1 더보기
[Android] GCM구현하기~! 우선은 Google Service Library가 필요하다 설치방법은 여기에~! 1. 아래의 Permission을 하나씩 추가해주자~! com.google.android.c2dm.permission.RECEIVEandroid.permission.INTERNETandroid.permission.GET_ACCOUNTSandroid.permission.WAKE_LOCKapplicationPackage + ".permission.C2D_MESSAGE"com.google.android.c2dm.intent.RECEIVE 4. service와 Broadcast도 등록~! 5. GCM id 받는 코드 작성~! 아래의 내용을 Activity에 넣는다. 결론을 말하자면 onCreate에서 this.mGcmRegId 값을.. 더보기
[Android] Google Service Library 추가하기~! 1. 우선은 Google Cloud Console 접속하여 프로젝트를 생성하자~!2. Project Number 발급을 받는다.3. GCM을 활성화 시킨다.~! (다른 기능도 마찬가지로 사용한다면 ON~!) 4. APIs & auth > Registered apps. 선택하여 Accessing APIs directly from Android 와 Package 와 SHA1 fingerprint 를 입력한다.SHA1 얻는 방법keytool -exportcert -alias androiddebugkey -keystore path-to-debug-or-production-keystore -list -v패스트워드를 입력하면... 이런식으로 나온다.. (본인은 debug.keystore로 하였다.) 귀찮으시면.. .. 더보기
[Android] intent로 Object 전달하기~! 전달할 객체를 Parcelable 인터페이스를 상속 받아서 아래와 같이 구현을 한다. 절대로 write와 Read순서는 항상 동일~!!!!!!! 절대 중요~!!! public class ReceivedDateDao implements Parcelable { public ReceivedDateDao () {}//end constructorpublic ReceivedDateDao (final Parcel in) {this.readFromParcel(in);}//end constructor@Overridepublic int describeContents() {return 0;}//end describeContents Method @Overridepublic void writeToParcel(Parcel des.. 더보기
[Spring Framework] RestTemplate 사용시 Caused by: java.io.EOFException 에러... 안드로이드에서 Spring Framework 의 RestTemplate을 사용하면서 종종Caused by: java.io.EOFException at libcore.io.Streams.readAsciiLine(Streams.java:203) at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:560) at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:813) at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274) at libcore.net.http.HttpURLConnectionImp.. 더보기
[Android] Maven 연동 & SpringFramework 설치하기~! Spring Framework를 쓰다보니.. Spring Framework for Android를 발견하였다~! 이번에 안드로이드 기기로 서버와 통신을 해야되어서 한번 사용해보았다. 자세한 사항은 여기에~! 1. 우선 이클립스에 Maven plugin 과 Android Configurator for M2E가 설치되어 있어야한다. 2. 안드로이드 프로젝트를 Maven을 쓸수 있도록 변환하자~! 이클립스에서 프로젝트를 오른쪽키를 눌러서 아래와 같이... 3. pom.xml에 라이브러리 추가~! org.springframework.android spring-android-rest-template 1.0.1.RELEASE org.springframework.android spring-android-auth 1... 더보기
[Android] In App Billing - Version3 적용하기~! Android In App Billing - Version3 적용하기~! 안드로이드 공식 홈페이지에서 참고하여 테스트를 진행해보았다. 1. 라이브러리 설치되었는지 확인한다. Android SDK Manager 에서 Extras Selection 이동~!Google Play Billing Library 가 설치되어있지 않으면 설치~!! 2. 설치가 완료되었다면 프로젝트에 적용하자~! 먼저 com.android.vending.billing 패키지를 생성한다.그리고 /extras/google/play_billing/이 경로로 가면 IInAppBillingService.aidl 를 발견수 있다.~! 해당 파일을 복사하여 아까전 생성한 패키지에 넣는다.~! 3. AndroidManifest.xml 에 billin.. 더보기
[Android] Nexus 7 2세대 개발자 모드로 전환!! 개발할려고 보니 개발자 모드가 없었다.. 태플릿 정보에 들어가서 빌드번호를 연타한다~!!!!! 개발자 옵션이 이제 보인다.~! 더보기
[cocos2d-x] CCDirector로 end() 함수 호출 문제... Cocos2d-x에서 CCDirector로 end() 함수를 호출할 때의 문제점은 계속해서 따라가면 terminateProcessJNI();를 호출하고 이건 cocos2d-2.0-x-2.0.4/cocos2dx/platform/android/java/src/org/cocos2dx 경로에 있는 Cocos2dxHelper의 terminateProcess() 를 부른다. 여기서 보면 android.os.Process.killProcess(android.os.Process.myPid()); 을하는데 이것을 activity를 static하게 저장하여 finish를 호출하는 방식으로 바꾸면 정상적인 종료가 된다. 더보기
[Android] Notification Bar View Custom 하기~! final NotificationManager manager = (NotificationManager)this.getSystemService(Context.NOTIFICATION_SERVICE); final Notification notification = new Notification(android.R.drawable.ic_input_add, message, System.currentTimeMillis()); final RemoteViews views = new RemoteViews(this.getPackageName(), R.layout.noti_content_view); views.setImageViewResource(R.id.noti_image, android.R.drawable.ic_input_.. 더보기