MYSTERY ZILLION တွင် English သို့မဟုတ် Unicode ဖြင့်သာ အသုံးပြုခွင့်ရှိသည်။ ဇော်ဂျီ ၊ ဧရာ စသည်တို့ကို အသုံးပြုခွင့် မရှိ။ Unicode fonts များမှာ Mon3,Yunghkio, Myanamr3 စသည်များ အသုံးပြုနိုင်သည်။ Unicode Guide ကို ဒီမှာ Download ချပါ။ Zawgyi to Unicode Converter
Don't share ebook or software if nobody request. You can find free book websites on here. We are welcome for discussion or asking question instead.

Dropbox api help????

edited June 2012 in Android Development
https://www.dropbox.com/developers/ က ပြောထားတဲ့ အတိုင်းလုပ်တာ အဆင်မပြေဘူးဖြစ်နေတယ်။ Google မှာလည်း တခြား Example လိုက်ရှာတာ မတွေ့ဘူး။ ပထမတော့ Thread နောက်တစ်ခု ထပ်လုပ်ထားတာကြောင့် Error ဖြစ်တယ်ထင်တာ အခုတော့မဟုတ်ဘူး Android Api ထည့်တာနည်းနည်းပြဿနာတက်နေတယ်။ ကျွန်တော်ရေးထားတာက အောက်ကအတိုင်းပါ။

<pre lang="java">
import com.dropbox.client2.DropboxAPI;
import com.dropbox.client2.android.AndroidAuthSession;
import com.dropbox.client2.session.AppKeyPair;
import com.dropbox.client2.session.Session.AccessType;



//Start Dropbox API
final static private String APP_KEY = "already-added-myapikey";
final static private String APP_SECRET = "already-added-mysecretkey";
final static private AccessType ACCESS_TYPE = AccessType.APP_FOLDER;
final static private String ACCOUNT_PREFS_NAME = "prefs";
final static private String ACCESS_KEY_NAME = "ACCESS_KEY";
final static private String ACCESS_SECRET_NAME = "ACCESS_SECRET";
private DropboxAPI<AndroidAuthSession> mDBApi;


public class monitorActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
start.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
noTemp=tMgr.getDeviceId();
phoneno.setText(noTemp);
createFile();
myTimer();
// Dropbox initialization function:
AppKeyPair appKeys = new AppKeyPair(APP_KEY, APP_SECRET);
AndroidAuthSession session = new AndroidAuthSession(appKeys, ACCESS_TYPE);
mDBApi = new DropboxAPI<AndroidAuthSession>(session);
mDBApi.getSession().startAuthentication(monitorActivity.this);
}
});
//On Resume For Dropbox
protected void onResume() {
super.onResume();

// ...

if (mDBApi.getSession().authenticationSuccessful()) {
try {
// MANDATORY call to complete auth.
// Sets the access token on the session
mDBApi.getSession().finishAuthentication();

AccessTokenPair tokens = mDBApi.getSession().getAccessTokenPair();

// Provide your own storeKeys to persist the access token pair
// A typical way to store tokens is using SharedPreferences
storeKeys(tokens.key, tokens.secret);
} catch (IllegalStateException e) {
Log.i("DbAuthLog", "Error authenticating", e);
}
}

// ...
}


}
</pre>

မှတ်ချက်များ

  • edited June 2012 Administrators
    what error message ?

    Did you read

    https://www.dropbox.com/developers/start/setup#android


    You didn't put API key in your code.

    Add your own API key in below code
    <pre lang="java">
    final static private String APP_KEY = "already-added-myapikey";
    final static private String APP_SECRET = "already-added-mysecretkey";
    final static private AccessType ACCESS_TYPE = AccessType.APP_FOLDER;
    final static private String ACCOUNT_PREFS_NAME = "prefs";
    final static private String ACCESS_KEY_NAME = "ACCESS_KEY";
    final static private String ACCESS_SECRET_NAME = "ACCESS_SECRET";
    </pre>
  • Administrators
    add activity

    <pre lang="xml">
    <activity
    android:name="com.dropbox.client2.android.AuthActivity"
    android:launchMode="singleTask"
    android:configChanges="orientation|keyboard">
    <intent-filter>
    <!-- Change this to be db- followed by your app key -->
    <data android:scheme="db-INSERT-APP-KEY-HERE" />
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.BROWSABLE"/>
    <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
    </activity>
    </pre>
Sign In or Register to comment.