質問

プライベートユーザーデータを安全に保存して、アプリの起動とデバイスのリセット全体にわたって持続できるようにする必要があります。

これは、最大で約1000枚のcharを推測する文字列になります。

このためにRim Keystore APIを使用できると言われました。

さて、私はリムキーストアAPI使用量でギデをグーグルでグーグルで費やしました。 JDEサンプルには、これに役立つものは含まれていません。

これはBB開発ではまれなことであるように見えるので、これに関する公式情報はほとんどありません。

私は読む これこれ. 。私が理解した人からは、私にとって最良の選択肢は、Persistablerimkeystoreを使用することです(デバイスのリセット全体で持続します)。ただし、実装が正確にどうあるべきかを理解することはできません。

誰かがサンプルコードを手伝ったり、ガイドを教えたりできますか?また、私のタスクにはより良い/単純な方法/アプローチがあるかもしれませんので、それについて教えてください。

よろしくお願いします!!!

役に立ちましたか?

解決

Persistablerimkeystoreは、RIMキーストアを保持するために使用されます。ユーザーデータの継続にリセットするには、PersistentStoreのみを使用する必要があります。Detaを保護したい場合は、ContentSprotectedHashTableまたはContentSprotectedVectorを使用できます。

他のヒント

ストアを使用している場合、「PersistentStoredemo」と同じでした。これは、file-> Import-> BlackBerryサンプルに移動することで取得できるとわからない場合は、ストアで情報を暗号化できます。これに加えて、ユーザーがコンテンツ保護を担当している場合、ContentSprotectedHashTableを使用して、その情報が暗号化されることを自動的に知ることができます。したがって、コンテンツ保護がなければ、情報は一度暗号化され、それをオンにして、二重に暗号化され、アプリの名前空間の長いハッシュを推測するのが難しいと保存されます(明らかに、必要なストアを登録するために)。以下は私が使用するものです:

package ca.dftr.phillyd.lib.persistables;

import net.rim.device.api.system.ApplicationDescriptor;
import net.rim.device.api.util.ContentProtectedHashtable;
import net.rim.device.api.util.Persistable;

/**
 * Basic class for storing application specific information. 
 * Information such as application settings or whether the license agreement was accepted.
 * For more complex and specific classes they should be implemented separately and implement persistable 
 * @author deforbes
 */
public class AppInfo extends ContentProtectedHashtable  implements Persistable {

    private String _appName = null;
    private String _version = null;

    /**
     * Constructs the application info, creates and persists a hashtable for application settings.
     * @param uniqueHexAppIdentifier Can be automatically created in resource class (BUNDLE_ID) or generated using other unique information.
     */
    public AppInfo() {    
        ApplicationDescriptor appDesc = ApplicationDescriptor.currentApplicationDescriptor();
        _appName = appDesc.getName();
        _version = appDesc.getVersion();
    }

    /**
     * Get the Name of the application
     * @return The application name from the app descriptor
     */
    public String getName()
    {
        return _appName;
    }

    /**
     * Get the Version of the application
     * @return The application version from the app descriptor
     */
    public String getVersion()
    {
        return _version;
    }
}

定数のクラス(必要に応じて上記に含めることができます)。たとえば、私のPhillyDアプリから:

パッケージca.dftr.phillyd.lib.persistables;

/**
 * Keys for the AppInfo array
 * @author deforbes
 */
public class AppInfoKeys {
    public static final String QUALITY = "Quality";
    public static final String CHANNEL = "Channel";
    public static final String CHANNEL_NAME = "Channel_Name";
    public static final String SEARCH = "Search";
    public static final String LICENSE_ACCEPTED = "isLicenseAccepted";
    public static final String VIDEOS_PER_PAGE = "NumPerPage";
    public static final Boolean DOWNLOAD_THUMBS = new Boolean(true);
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top