本文整理汇总了Java中com.parse.ParseTwitterUtils类的典型用法代码示例。如果您正苦于以下问题:Java ParseTwitterUtils类的具体用法?Java ParseTwitterUtils怎么用?Java ParseTwitterUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParseTwitterUtils类属于com.parse包,在下文中一共展示了ParseTwitterUtils类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: signInTwitter
import com.parse.ParseTwitterUtils; //导入依赖的package包/类
private void signInTwitter() {
ParseTwitterUtils.logIn(getActivity(), new LogInCallback() {
@Override
public void done(ParseUser parseUser, ParseException e) {
if (e == null) {
boolean fullyRegistered = parseUser.getBoolean(ParseTables.Users.FULLY_REGISTERED);
if (parseUser == null) {
Log.d(TAG, "Uh oh. The user cancelled the Twitter login.");
} else if (!fullyRegistered || parseUser.isNew()) {
Log.d(TAG, "User signed up and logged in through Twitter!");
getTwitterData();
} else {
Log.d(TAG, "User logged in through Twitter!");
Utils.goToMainActivity(getActivity());
}
} else {
e.printStackTrace();
}
}
});
}
开发者ID:championswimmer,项目名称:Bookd_Android_App,代码行数:22,代码来源:SignOnFragment.java
示例2: onCreate
import com.parse.ParseTwitterUtils; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Fresco.initialize(this);
Parse.enableLocalDatastore(this);
Parse.initialize(this, "Qkf0ETa2dogBX3ot1BgSswy09PR6fAK6vJEMGcof", "KqV8lTovHNQQPuZ819qzCHK617uXvJIkWpxaqLkf");
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
ParseFacebookUtils.initialize(this);
ParseTwitterUtils.initialize("J3ncUDAVwYhOPRadv1kD7Z75G","bVSeScEZB8u7jFnLQmtk0FiCTdw1vIJJpfapTDrHDoVFLEOFCP");
}
开发者ID:championswimmer,项目名称:Bookd_Android_App,代码行数:12,代码来源:ApplicationWrapper.java
示例3: onCreate
import com.parse.ParseTwitterUtils; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
// Parse.enableLocalDatastore(this);
Parse.initialize(this, "9nhyJ0OEkfqmGygl44OAYfdFdnapE27d9yj9UI5x", "7pJlc2KZgpFXZHwvoXwVeZUsEtiDoTrtjPM7EGBa");
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
ParseFacebookUtils.initialize(this);
ParseTwitterUtils.initialize("FfUOeQ5OBuv0qOkdHbfXCrwdk", "xQmFnUSii54eS3iUrl0uIrxfeL4EfIdFc6iyoHUDgSIVGDbauD");
Fresco.initialize(this);
}
开发者ID:teamOSC,项目名称:Studddinv2_android,代码行数:12,代码来源:ApplicationWrapper.java
示例4: onCreate
import com.parse.ParseTwitterUtils; //导入依赖的package包/类
@Override
public void onCreate() {
SharedPreferences sPref = getSharedPreferences("location", MODE_PRIVATE);
currentLatitude = Double.valueOf(sPref.getString("lastLatitude", "28.6328"));
currentLongitude = Double.valueOf(sPref.getString("lastLongitude", "77.2197"));
Parse.initialize(this, "tA24P8ZHIuY6T6GCePmlwS94r7DKYIl0DrYee41g", "1pJVaZcK43AXO6wAtDzqPs1GMkA1E3jHtXTNCzKc");
ParseFacebookUtils.initialize(this);
ParseTwitterUtils.initialize("PdLB1zaNjktVXpBqPddVMWENt", "ND4JkQj7lucz1uQO0URF3mBfQFORIzSKY2oHUPZGtJgbaDzZLY");
buildGoogleApiClient();
super.onCreate();
}
开发者ID:Greplr,项目名称:Greplr_Android,代码行数:13,代码来源:App.java
示例5: loginTwitter
import com.parse.ParseTwitterUtils; //导入依赖的package包/类
public void loginTwitter(View view) {
showActivityIndicator();
// network not available
if (!Utils.isNetworkAvailable(getApplicationContext())) {
Toast.makeText(getApplicationContext(), "Network not available", Toast.LENGTH_SHORT).show();
hideActivityIndicator();
return;
}
ParseTwitterUtils.initialize(ParseConsts.TWITTER_CONSUMER_KEY, ParseConsts.TWITTER_CONSUMER_SECRET);
ParseTwitterUtils.logIn(this, new LogInCallback() {
@Override
public void done(ParseUser user, ParseException ex) {
hideActivityIndicator();
if (user == null) {
String errMsg ;
if (ex == null){
errMsg = "Sorry, but looks like you cancelled the Twitter login";
}else {
errMsg = "Unable to login using Twitter " + ex.getMessage();
}
Toast.makeText(getApplicationContext(), errMsg, Toast.LENGTH_SHORT).show();
} else {
Utils.setCurrentUsername(user.getUsername());
saveInstallationID();
showHome();
}
}
});
}
开发者ID:jerrymannel,项目名称:ISawABird,代码行数:34,代码来源:LoginActivity.java
示例6: doTwitterSignOn
import com.parse.ParseTwitterUtils; //导入依赖的package包/类
public void doTwitterSignOn(View v) {
mProgressDialog.setMessage("Signing in via Twitter");
mProgressDialog.show();
ParseTwitterUtils.logIn(getActivity(), new LogInCallback() {
@Override
public void done(ParseUser user, ParseException err) {
mProgressDialog.dismiss();
if (err != null) {
err.printStackTrace();
return;
}
if (user == null) {
Log.w(TAG, "Uh oh. The user cancelled the Twitter login.");
} else {
boolean fullyRegistered = false;
try {
fullyRegistered = user.getBoolean(ParseTables.Users.FULLY_REGISTERED);
} catch (Exception ignored) {
}
if (user.isNew() || (!fullyRegistered)) {
Log.w(TAG, "User signed up and logged in through Twitter!" + ParseTwitterUtils.getTwitter().getScreenName());
TwitterApi.getTwitterData(new TwitterApi.TwitterDataCallback() {
@Override
public void gotData(Bundle bundle) {
// final SignupDataFragment fragment = showSignupDataFragment(bundle);
new PushUserIntoParse().execute(bundle);
/*
TwitterApi.getUserInfo(new TwitterApi.TwitterInfoCallback() {
@Override
public void gotInfo(JSONObject object, Bitmap profileBitmap, Bitmap coverBitmap) throws JSONException {
fragment.profileBitmap = profileBitmap;
fragment.bitmapReady = true;
fragment.setProfilePicture();
fragment.setCoverPicture(coverBitmap);
}
});*/
}
});
} else {
Log.w(TAG, "User logged in through Twitter!");
SignupDataFragment.goToMainActivity(getActivity());
}
}
}
});
}
开发者ID:teamOSC,项目名称:Studddinv2_android,代码行数:48,代码来源:SignOnFragment.java
示例7: onCreate
import com.parse.ParseTwitterUtils; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor(getResources().getColor(R.color.primary_dark));
}
mUsernameField = (EditText) findViewById(R.id.login_email);
mPasswordField = (EditText) findViewById(R.id.login_password);
mErrorField = (TextView) findViewById(R.id.error_messages);
spinner = (ProgressBar)findViewById(R.id.progressBar1);
spinner.setVisibility(View.GONE);
Parse.initialize(this);
Parse.setLogLevel(Parse.LOG_LEVEL_DEBUG);
/** Get twitter auth data - In parse create new table , in this template I have called it "tw" & add string type columns "keyid" & "secretid"
* The benefit of this method is that if you need to revoke twitter keys, you just need to modify them in the table only. No need to for new app update.
* If you want to avoid doing it this way, then simply remove whole of the below code with just this one line & pass your keys as parameters.
* ParseTwitterUtils.initialize(tw_consumer_key, tw_consumer_secret);
* But with this you will have to push an app update in case you revoke your twitter keys.
*/
ParseQuery<ParseObject> qtw = ParseQuery.getQuery("tw");
qtw.getFirstInBackground(new GetCallback<ParseObject>() {
@Override
public void done(ParseObject obj, ParseException e) {
if(e==null){
String tw_consumer_key = obj.get("keyid").toString();
String tw_consumer_secret = obj.get("secretid").toString();
ParseTwitterUtils.initialize(tw_consumer_key, tw_consumer_secret);
}
else {
Log.d("Tw: Error", e.getMessage());
}
}
});
}
开发者ID:bhavyanshu,项目名称:TemplateAppParse-dot-com,代码行数:48,代码来源:LoginActivity.java
注:本文中的com.parse.ParseTwitterUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论