2014년 1월 28일 화요일

Notification()이 아닌 NotificationCompat 사용시 에러.

  notification.when = System.currentTimeMillis();
  notification.icon = res.getIdentifier("com.dj.NEWCLEAR:drawable/app_icon", null, null);
  notification.defaults = Notification.DEFAULT_ALL;
  //notification.vibrate = new Long[]{100, 50, 100, 50};
  notification.flags |= Notification.FLAG_AUTO_CANCEL;
  notification.tickerText = "스틱 교체가 필요합니다.";
  notification.setLatestEventInfo(arg0, strTitle, strMsg, pendingIntent);

Notification() 사용시에 지금은 크게 문제가 없으나.
setLatestEventInfo 함수는 곧 패기(?)된다 ㅠㅠ

따라서 이후 버전에서도 지원이 되는 API를 사용하여야 하는대.

  Resources res = getResources();
  Notification notification = new NotificationCompat.Builder(arg0)
  .setContentTitle("NEWCLEAR")
  .setContentText("NEWCLEAR - 스틱 교체가 필요합니다.")
  .setSmallIcon(res.getIdentifier("com.dj.NEWCLEAR:drawable/app_icon", null, null))
  .setDefaults(Notification.DEFAULT_ALL)
  .setAutoCancel(true)
  .setTicker("NEWCLEAR - 스틱 교체가 필요합니다.")
  .setContentIntent(pendingIntent)
  .build();

NotificationCompat 객체를 사용하면 된다고 한다.

그래서 이  API를 이용해 push를 했으나.. push 메세지는 깜깜무소식..

LogCat에서 오류를 보니

at com.google.android.gcm.GCMBaseIntentService.onHandleIntent(GCMBaseIntentService.java:223)

이라는 오류가 있었다.

그리고 검색해보니

There is a support library bug filed for this, see here. A fixed v4 support library can be downloaded fromthis link in comment #2.

버그가 있다는것이다...(아마 최신버전의 sdk를 즉각즉각 업데이트 하신분은 이런 문제가 없으실듯)

다른 분의 말에 따르면
 
This is a known bug in android-support-v4.jar before rev11.
To get the latest android-support-v4.jar:
 
즉 rev11 이하의 버전에서만 가지고 있는 버그라고 한다. 즉시 업데이트 해주도록 하자.
 
 
 

2014년 1월 15일 수요일

Unity 다이어그램?, 클래스 정리?

Doxygen

이라는 솔루션이 있다.

이번에 프로젝트를 마치고 유니티 프로젝트를 정리 하기위해 검색하다가 찾았다.


현재 프로젝트에 포함된 스크립트를 정리해서 문서로 만들어준다.
(마치 JAVA API 가이드 문서처럼 만들어 준다 지져스...)

http://forum.unity3d.com/threads/128355-Free-Plugin-for-Automatic-Documentation-of-your-project-through-Doxygen
링크

http://www.youtube.com/watch?v=1TwXMYUZ-2w
활용 동영상

2014년 1월 9일 목요일

아이폰 빌드 오류(앱 GameCenter 기능 제외 후 생긴 오류)

오류 내용.

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_GKLeaderboardViewController", referenced from:
      objc-class-ref in libiPhone-lib.a(GameCenter.o)
  "_OBJC_CLASS_$_GKScore", referenced from:
      objc-class-ref in libiPhone-lib.a(GameCenter.o)
  "_OBJC_CLASS_$_GKAchievement", referenced from:
      objc-class-ref in libiPhone-lib.a(GameCenter.o)
  "_OBJC_CLASS_$_GKAchievementDescription", referenced from:
      objc-class-ref in libiPhone-lib.a(GameCenter.o)
  "_OBJC_CLASS_$_GKLeaderboard", referenced from:
      objc-class-ref in libiPhone-lib.a(GameCenter.o)
  "_OBJC_CLASS_$_GKPlayer", referenced from:
      objc-class-ref in libiPhone-lib.a(GameCenter.o)
  "_GKErrorDomain", referenced from:
      GameCenter::CreateUserImage(UIImage*, NSError*) in libiPhone-lib.a(GameCenter.o)
  "_OBJC_CLASS_$_GKAchievementViewController", referenced from:
      objc-class-ref in libiPhone-lib.a(GameCenter.o)
  "_OBJC_CLASS_$_GKLocalPlayer", referenced from:
      objc-class-ref in libiPhone-lib.a(GameCenter.o)
ld: symbol(s) not found for architecture armv7

clang: error: linker command failed with exit code 1 (use -v to see invocation)

해결책.

It looks like you haven't added the GameKit framework to your project.
If your using Xcode 3.2.x:
  • Right click the Frameworks group/folder in the file tree (on the left of the xcode window)
  • Press Add, and then select Existing Frameworks...
  • Scroll to GameKit.framework and double click it
If your using Xcode 4:
  • In the file tree, click on the project (the item at the top)
  • Select your target
  • Go to the Build Phases tab on the main panel
  • Expand the Link Binary with Libraries
  • Press the + button
  • Scroll to the GameKit.framework and double click it.