2011年1月23日日曜日

[AndroidFace Ver.1.3] リリース

 [AndroidFace Lite Ver.1.3] をリリースしました。
 * 追加ファイル対応 (Faceパターンをダウンロードして追加できます。)
 * 表情のプレビュー機能追加
 * shibainuの表情が、電波強度とは逆に反応していたのを修正



追加のFaceパターンファイルは、設定画面の"Faceパターンを取得する"で、検索することができます。
もしくは、マーケットで "AndroidFace"を検索します。

今回のリリースでは、以下の追加ファイルが公開されています。
- AndroidFace FriendlyFire
- AndroidFace ウサギ   * 兎年ですから!!

2010年10月4日月曜日

外部APKからリソースを取得する方法

// 外部APKのパッケージ名
String packageName = "my.droid.example.outerresources";

Context context;
try {
    // パッケージ名からコンテキストを作成
    context = this.createPackageContext(packageName, Context.CONTEXT_RESTRICTED);
    //context = this.createPackageContext(packageName, Context.CONTEXT_IGNORE_SECURITY);

    // リソースの取得
    Resources res = context.getResources();

    // asset に下に作成したimagesディレクトリからファイルを取得
    AssetManager as = res.getAssets();
    String[] files = as.list("images");
    for(String file : files) {
        Log.d(TAG, "AssetFile="+file);
        InputStream is = as.open(file);
        Bitmap bitmap = BitmapFactory.decodeStream(is);
        ImageView imageView = new ImageView(this);
        imageView.setImageBitmap(bitmap);
        linearLayout.addView(imageView);
    }

    // res/drawable からイメージを取得
    int resId = res.getIdentifier("icon", "drawable", packageName);
    ImageView imageView = new ImageView(this);
    imageView.setImageDrawable(res.getDrawable(resId));
    linearLayout.addView(imageView);

} catch (NameNotFoundException e) {
    e.printStackTrace();
} catch (IOException e) {
    e.printStackTrace();
}

2010年9月19日日曜日

[AndroidFace Lite Ver.1.0.2 Beta] をリリース

 [AndroidFace Lite Ver.1.0.2 Beta] をリリースしました。
 * Faceパターンが変化しなくなるバグ修正
 * 目をもう少し大きいものに変更

システムからServiceが強制停止された後に新しくウィジェットを配置すると既存のウィジェットが更新されなっていた。
RemoteViewsの更新のときに、ウィジェットが配置されたときのWidgetIdをHashSetに保存していたが、Serviceの再起動でクリアされる。 
その為、元々あったウィジェットのWidgetIdはHashSetに存在しないため、アップデートされなくなっていた。
WidgetId毎に更新する必要はないので、 AppWidgetProviderを指定してすべてのウィジェットを更新するように変更。

[AndroidFace Lite Ver.1.0.2 Beta] was Released.

[AndroidFace Lite Ver.1.0.2 Beta] was Released.

 * Fixed a bug that does not change the face-pattern
 * Modified eyes to bigger

2010年8月31日火曜日

[AndroidFace v1.1.3 Beta] was Released.

[AndroidFace v1.1.3 Beta] をリリースしました。 Faceパターンで5つ以上のパーツを表示するようになりました。

[AndroidFace v1.1.3 Beta] was Released. Five or more display parts of the Face-Pattern.


Faceパターンのパーツの表示を5つまでしか対応をしていませんでした。
一部のFaceパターンでは6以上のパーツを使用しているものがありましたので、表示できるように対応したものです。

2010年8月11日水曜日

android.content.ReceiverCallNotAllowedException: IntentReceiver components are not allowed to bind to services

IntentReceiver から Serviceをbindすることは出来ない。

08-11 07:14:51.487: ERROR/AndroidRuntime(1614): Caused by: android.content.ReceiverCallNotAllowedException: IntentReceiver components are not allowed to bind to services

Receiver call not allowed Exception <- レシーバはコールすることが出来ない例外
IntentReceiverコンポーネントがサービスにバインドすることはできません

AppWidgetはIntennt Receiverなので

onUpdate()メソッドの中で、

Intent serviceIntent = new Intent(IService.class.getName());
context.bindService(serviceIntent, conn, Context.BIND_AUTO_CREATE);

とすると例外が発生する。


BroadcastReceiverのドキュメントは、

If this BroadcastReceiver was launched through a tag, then the object is no longer alive after returning from this function.This means you should not perform any operations that return a result to you asynchronously -- in particular, for interacting with services, you should use startService(Intent) instead of bindService(Intent, ServiceConnection, int). If you wish to interact with a service that is already running, you can use peekService(Context, Intent).

とあります。


Intent serviceIntent = new Intent(context, MyService.class);
context.startService(serviceIntent);
IBind bind = peekService(context, serviceIntent);

としてみても、bindはNULLになります。

はてさてどうしたものか...

2010年8月10日火曜日

AndroidFace Liteをリリースしています。

AndroidFaceの簡易版AndroidFace Liteをリリース。

AndroidFaceのブラッシュアップする為に作成したものです。
MacFace対応とか削り、基本機能のみとなってます。

Serviceまわりをリコーディングしたので、挙動は安定しているはず。。。