How to Integrate Yahoo in Android - android

I'm very new to android development & I'm developing a yahoo login integration in Android App and return into main Activity. I have completed all the steps of yahoo integration.I have spent several days for searching yahoo integration in android but i cant find proper way.When i run this Application the Toast will appear consist of message:-
(E/Communication with the service provider failed: null(4194): oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: null)
then dialog box will appear with OAuth pin....Kindly any one help me about from where I get the OAuth pin and how can I retrieve yahoo mails by this Integration.
package com.example.yhoointegration;
public class MainActivity extends ActionBarActivity {
private static final String REQUEST_TOKEN_ENDPOINT_URL = "https://api.login.yahoo.com/oauth/v2/get_request_token";
private static final String ACCESS_TOKEN_ENDPOINT_URL = "https://api.login.yahoo.com/oauth/v2/get_access_token";
private static final String AUTHORIZE_WEBSITE_URL = "https://api.login.yahoo.com/oauth/v2/request_auth";
private static final int PIN_DIALOG = 0;
String CALLBACK_URL = ""; // this should be the same as
// the
// SCHEME and HOST values in
// your AndroidManifes""t.xml file
String CONSUMER_KEY = "";
String CONSUMER_SECRET = "";
private CommonsHttpOAuthConsumer myConsumer;
private CommonsHttpOAuthProvider myProvider;
private String requestToken;
private String accessToken;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
callOAuth();
showDialog(PIN_DIALOG);
}
private void callOAuth() {
try {
// retrieve the consumer token and then sign it
myConsumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY,
CONSUMER_SECRET);
myConsumer.setMessageSigner(new HmacSha1MessageSigner());
HttpClient client = new DefaultHttpClient();
// retrieve the provider by using the signed consumer token
myProvider = new CommonsHttpOAuthProvider(
REQUEST_TOKEN_ENDPOINT_URL, ACCESS_TOKEN_ENDPOINT_URL,
AUTHORIZE_WEBSITE_URL, client);
myProvider.setOAuth10a(true);
String aUrl = myProvider.retrieveRequestToken(myConsumer,
CALLBACK_URL);
requestToken = myConsumer.getToken();
Log.e("Token///", "" + requestToken);
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(aUrl)));
} catch (Exception ex) {
Toast.makeText(getApplicationContext(), ex.getMessage(),
Toast.LENGTH_LONG).show();
Log.e(ex.getMessage(), ex.toString());
}
}
// this is the callback function that will run when oauth authenticates
// successfully
#Override
protected void onNewIntent(Intent intent) {
System.out.println("OnNewIntent...");
Toast.makeText(getApplicationContext(), "OnNewIntent - It works!",
Toast.LENGTH_LONG).show();
// whatever you want to do after authenticating goes here ....
}
AlertDialog createPinDialog() {
LayoutInflater factory = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
// LayoutInflater factory = LayoutInflater.from(this);
final View textEntryView = factory.inflate(R.layout.pin, null);
final EditText pinText = (EditText) textEntryView
.findViewById(R.id.pin_text);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Twitter OAuth PIN");
builder.setView(textEntryView);
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (pinText != null)
gotOAuthPin(pinText.getText().toString());
onResume();
}
});
return builder.create();
}
private void gotOAuthPin(String pin) {
SharedPreferences.Editor editor = getSharedPreferences("yahoo",
MODE_PRIVATE).edit();
try {
myProvider.retrieveAccessToken(myConsumer, pin);
accessToken = myConsumer.getToken();
} catch (OAuthMessageSignerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (OAuthNotAuthorizedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (OAuthExpectationFailedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (OAuthCommunicationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (accessToken != null && accessToken.length() > 0) {
Toast.makeText(this, "Authorized", Toast.LENGTH_SHORT).show();
HttpPost request = new HttpPost(
"http://social.yahooapis.com/v1/user/profile?format=json");
StringEntity body = null;
/*
* try { body = new StringEntity("city=hamburg&label=" +
* URLEncoder.encode("Send via Signpost!", "UTF-8")); } catch
* (UnsupportedEncodingException e1) { // TODO Auto-generated catch
* block e1.printStackTrace(); }
* body.setContentType("application/x-www-form-urlencoded");
* request.setEntity(body);
*/
try {
myConsumer.sign(request);
} catch (OAuthMessageSignerException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (OAuthExpectationFailedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (OAuthCommunicationException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
System.out.println("Sending update request to Fire Eagle...");
HttpClient httpClient = new DefaultHttpClient();
HttpResponse response = null;
try {
response = httpClient.execute(request);
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Toast.makeText(
this,
"Response: " + response.getStatusLine().getStatusCode()
+ " " + response.getStatusLine().getReasonPhrase(),
Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(this, "Not Authorized", Toast.LENGTH_SHORT).show();
}
}
#Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case PIN_DIALOG:
LayoutInflater factory = LayoutInflater.from(this);
final View textEntryView = factory.inflate(R.layout.pin, null);
final EditText pinText = (EditText) textEntryView
.findViewById(R.id.pin_text);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("OAuth PIN");
builder.setView(textEntryView);
builder.setPositiveButton("OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int whichButton) {
if (pinText != null)
gotOAuthPin(pinText.getText().toString());
}
});
return builder.create();
}
return super.onCreateDialog(id);
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
#Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}

Related

unfortunately android application has been stopped. At Http Post while attempting to call server

Unfortunately android application has been stopped. At Http Post while attempting to call server at post activity please help
HttpClient cli = new DefaultHttpClient();
//HttpPost post = new HttpPost("http://" + sp.getString("ip", "localhost") + "/attendance/cliLogin.php");
HttpPost post = new HttpPost("localhost/attendance/");
// seting post data
List<NameValuePair> loginData = new ArrayList<NameValuePair>(2);
loginData.add(new BasicNameValuePair("uname", uname));
loginData.add(new BasicNameValuePair("pass", pass));
post.setEntity(new UrlEncodedFormEntity(loginData));
// executing login
HttpResponse res = cli.execute(post);
HttpEntity resent = res.getEntity();
String result = EntityUtils.toString(resent);
// reading response
if(result.equals("NoParams"))
Commons.showToast("Something went wrong", true);
else if(result.equals("Login"))
{
navi = new Intent(this, HomeActivity.class);
startActivity(navi);
}
else
Commons.showToast(result, true);
}
catch (HttpHostConnectException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Commons.showToast("Can't reach server, check the Hostname", true);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
else
Commons.showToast("Username/Password can't be empty", true);
}
}
Could you please share your logcat to see the error? I think that your are calling the php script in your main thread (that is your activity thread) and you may have NetworkOnMainThreadException
If that is the case:
Create a class that extends the AsyncTask.
Override its methods.
In the creator of this class pass the variables and assign them to the fields (variables) of your class.
Make your post in an AsyncTask inside the doInBackground method
And call the AsyncTask execute. Like this:
public class MyTask extends AsyncTask<String,String,String>{
private short errorType = -1;
private String result;
private String uname;
private String pass;
public MyTask(String uname, String pass){
this.uname = uname;
this.pass = pass;
}
#Override
protected String onPostExecute(Void result) {
// TODO Auto-generated method stub
super.onPostExecute(result);
if (errorType == 1){
Commons.showToast("Can't reach server, check the Hostname", true);
}
if(result.equals("NoParams")) {
Commons.showToast("Something went wrong", true); }
else if(result.equals("Login")) {
Intent navi = new Intent(this, HomeActivity.class); startActivity(navi);
}
else {
Commons.showToast(result, true);
}
}
#Override
protected void onPreExecute() {
// TODO Auto-generated method stub
super.onPreExecute();
}
#Override
protected String doInBackground(String... params) {
try
{
HttpClient cli = new DefaultHttpClient();
HttpPost post = new HttpPost("localhost/attendance/");
List<NameValuePair> loginData = new ArrayList<NameValuePair>(2);
loginData.add(new BasicNameValuePair("uname", uname));
loginData.add(new BasicNameValuePair("pass", pass));
post.setEntity(new UrlEncodedFormEntity(loginData));
// executing login
HttpResponse res = cli.execute(post);
HttpEntity resent = res.getEntity();
return result = EntityUtils.toString(resent);
}
catch (HttpHostConnectException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
errorType = 1;
return null;
}
catch (ParseException e) {
// TODO Auto-generated catch block e.printStackTrace();
errorType = 2;
return null;
}
catch (IOException e) {
// TODO Auto-generated catch block e.printStackTrace();
errorType = 3;
return null;
}
catch(Exception e){
errorType = 4;
return null;
}
}
}
And inside the activity make your call like this:
MyTask new MyTask(uname, pass).execute();
Again. All this is applicable only if you have
NetworkOnMainThreadException
Please share your logcat for further help.

Decrypt file with facebooks conceal library

I'm trying to use conceal facebook library to encrypt and decrypt some audio files.
So the encryption phase has no problem but the subsequent phase of decryption always ends with the following error:
com.facebook.crypto.cipher.NativeGCMCipherException: decryptFinal
at com.facebook.crypto.cipher.NativeGCMCipher.decryptFinal(NativeGCMCipher.java:108)
at com.facebook.crypto.streams.NativeGCMCipherInputStream.ensureTagValid(NativeGCMCipherInputStream.java:126)
at com.facebook.crypto.streams.NativeGCMCipherInputStream.read(NativeGCMCipherInputStream.java:91)
at com.facebook.crypto.streams.NativeGCMCipherInputStream.read(NativeGCMCipherInputStream.java:76)
This is my code:
public class Main extends Activity {
private Button btnEncrypt, btnDecrypt, btnPlay, btnStop;
private final String mediaPath = Environment.getExternalStorageDirectory().getPath();
private File file;
private String media;
private NativeCryptoLibrary mNativeCryptoLibrary;
private Crypto crypto;
private keyChain key;
private Entity entity;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnEncrypt = (Button) findViewById(R.id.btnEncrypt);
btnDecrypt = (Button) findViewById(R.id.btnDecrypt);
mNativeCryptoLibrary = new SystemNativeCryptoLibrary();
key = new keyChain();
crypto = new Crypto(key, mNativeCryptoLibrary);
if (!crypto.isAvailable()) {
Log.e("ERROR: ", "crypto not available!");
return;
}
media = mediaPath+"/example.mp3";
file = new File(media);
entity = new Entity("TEST");
if (savedInstanceState == null) {
getFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment()).commit();
}
btnEncrypt.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
OutputStream fileStream, outputStream;
try {
final byte[] encrypt = new byte[(int) file.length()];
fileStream = new BufferedOutputStream(new FileOutputStream(media));
// encrypt
outputStream = crypto.getCipherOutputStream(fileStream, entity);
outputStream.write(encrypt);
outputStream.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (CryptoInitializationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (KeyChainException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
btnDecrypt.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
FileInputStream fileStream;
OutputStream out;
try {
fileStream = new FileInputStream(media);
InputStream inputStream = crypto.getCipherInputStream(fileStream, entity);
out = new FileOutputStream (Environment.getExternalStorageDirectory().getPath()+"/decrypt.mp3");
int read;
byte[] buffer = new byte[1024];
while ((read = inputStream.read(buffer)) != -1) {
out.write(buffer, 0, read);
}
inputStream.close();
out.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (CryptoInitializationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (KeyChainException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
#Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {
public PlaceholderFragment() {
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container,
false);
return rootView;
}
}
}
I've found this post Problems with facebooks conceal library but i still can't solve my problem.

The difference between playing video via URL and player

I'm developing an Android app that can parse both the Youtube and Dailymotion webpages,and render its URL of videos, but the buffering speed is not stable.
Sometimes, the video is buffered fast via its Website native player, but it is buffered slow in my Android Videoview.
How can I fix the problem, and what kind of difference is there between these two ways to play Video?
private class isConnected extends AsyncTask<String, Void, Boolean> {
Boolean result;
public isConnected(Boolean r)
{
result = r;
}
protected Boolean doInBackground(String... params) {
HttpClient client = new DefaultHttpClient();
String getURL = params[0];
HttpGet get = new HttpGet(getURL);
HttpResponse responseGet = null;
try {
responseGet = client.execute(get);
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
Toast.makeText(getBaseContext(), "Error:" + e.getMessage(), Toast.LENGTH_LONG).show();
return false;
} catch (IOException e) {
// TODO Auto-generated catch block
//e.printStackTrace();
Toast.makeText(getBaseContext(), "Error:" + e.getMessage(), Toast.LENGTH_LONG).show();
return false;
}
if(responseGet.getStatusLine().getStatusCode() == HttpStatus.SC_OK)
result = true;
else
result = false;
return result;
}
protected void onPostExecute(Boolean r) {
// here you have the result
result = r;
}
}
VideoView videoView;
String URL;
videoView.setVideoPath(URL);
myVideoView.setOnPreparedListener(
new OnPreparedListener() {
#Override
public void onPrepared(MediaPlayer arg0) {
arg0.setOnBufferingUpdateListener(new OnBufferingUpdateListener(){
#Override
public void onBufferingUpdate(MediaPlayer mp, int percent) {
// TODO Auto-generated method stub
Log.d("123","Buffer Percentage = " + percent);
}});
// TODO Auto-generated method stub
new isConnected(video_ready).execute(URL);
if (!video_ready)
{
progDailog.dismiss();
AlertDialog.Builder alert = new AlertDialog.Builder(HomeActivity.this);
alert.setTitle("Warning").setMessage("The URL of video is incorrect.").setNeutralButton("OK", null);
alert.create().show();
}
if (progDailog.isShowing())
{
progDailog.dismiss();
}
videoView.start();
}
});

Getting row ID of dynamic listview in android to add to cart

I have dynamic listview on my android client app that receive data from remote mysql DB. I have a context menu that opens on user click on any row i that listview. There is an option named' add to cart' on that menu. I want to add the clicked row item to the cart when that context menu option is selected. So how do I get the row ID for adding that slected/clicked row item to the cart just like shopping carts? I later need to display the selected row item in my 'Show Cart' class..Pls help..thanks in advance. I didnt find much articles that discuss about it with actual code .my listview display class is here:
public class MainMenu extends ListActivity {
Intent intent = getIntent();
InputStream is;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String result = "";
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://10.0.2.2/phpmyadmin/php.php");
HttpResponse response = null;
try {
response = httpclient.execute(httppost);
} catch (ClientProtocolException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
HttpEntity entity = response.getEntity();
try {
is = entity.getContent();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Log.e("log_tag", "connection success ");
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(is,"iso-8859-1"),8);
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
StringBuilder sb = new StringBuilder();
String line = null;
try {
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
is.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
result=sb.toString();
JSONArray jArray = null;
try {
jArray = new JSONArray(result);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
int arrayLength=jArray.length();
String F_NAME[]=new String[arrayLength];
for(int i=0;i<arrayLength;i++){
JSONObject json_data = null;
try {
json_data = jArray.getJSONObject(i);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
F_NAME[i]=json_data.getString("F_NAME");
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}}
setListAdapter(new ArrayAdapter<String>(this, R.layout.list,F_NAME));
ListView lv = getListView();
lv.setTextFilterEnabled(true); registerForContextMenu(lv);}
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.fltmenu, menu); menu.setHeaderTitle("Ask for");}
public boolean onContextItemSelected(MenuItem item) { //find out which menu item was pressed switch (item.getItemId()) {
case R.id.ToCart:
Dotocart();
return true;
default:
return false;}}private void Dotocart() {}
#Override
public boolean onContextItemSelected(MenuItem item) {
AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)item.getMenuInfo();
int menuItemIndex = item.getItemId();
int position = (info.position);
....
the menuItem index returns the context menu item selected (add to chart, ...) and the info.position the position of the list that was clicked. (if you also have the list of data that populated the list view you can get it by the same index.

me/feed not posting to facebook wall

My facebook wall posting AND checkins were working until last week... Now they have stopped working. it is really strange... I am not sure what is causing it.
I can login to facebook fine. That is proven because I can receive my facebook profile picture.
At the top of the class extending activity I have specified these fields:
private static final String APP_ID = "286529654765268";
private static final String[] PERMISSIONS = {"publish_stream", "publish_actions", "publish_checkins", "create_event"};
private static final String TOKEN = "access_token";
private static final String EXPIRES = "expires_in";
private static final String KEY = "facebook-credentials";
private Facebook facebook = new Facebook(APP_ID);
I use the facebook object throughout my class.
This is how I post a message:
defaultMessage = edittext.getText().toString();
String response = null;
try{
SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences("settings", 0);
String imageUrl = "www.somesite.com/somejpg.jpg";
Bundle params = new Bundle();
params.putString(Facebook.TOKEN, facebook.getAccessToken());
params.putString("caption", defaultMessage);
params.putString("description", "a description");
params.putString("picture", imageUrl);
params.putString("name", "A Name");
//
response = facebook.request("me/feed", params, "POST");
facebook.request("me/feed", params, "POST");
} catch(Exception e){
e.getStackTrace();
}
if(response != "false" || response != null){
Toast.makeText(getApplicationContext(), "Status Updated Successfully!", Toast.LENGTH_LONG).show();
Log.e("facebook response", response);
}
I authorize onCreate. Here is where I do it:
public void facebookAuthorize(){
facebook.authorize(this, PERMISSIONS, Facebook.FORCE_DIALOG_AUTH, new DialogListener() {
#Override
public void onComplete(Bundle values) {
String me = null;
String id = null;
try {
me = facebook.request("me");
} catch (MalformedURLException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
} catch (IOException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
JSONObject json_id = null;
try {
json_id = new JSONObject(me);
} catch (org.json.JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
id = json_id.getString("id");
} catch (org.json.JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Log.e("Id", id);
URL img_value = null;
try {
img_value = new URL("http://graph.facebook.com/"+id+"/picture?type=large");
} catch (MalformedURLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Bitmap mIcon1 = null;
try {
mIcon1 = BitmapFactory.decodeStream(img_value.openConnection().getInputStream());
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
if(mIcon1 != null){
badge.setImageBitmap(mIcon1);
}
Toast.makeText(getApplicationContext(), "Successfully logged in!", Toast.LENGTH_LONG).show();
}
#Override
public void onFacebookError(FacebookError error) {}
#Override
public void onCancel() {}
#Override
public void onError(com.facebook.android.DialogError e) {
// TODO Auto-generated method stub
}
});
if(restore(facebook, getApplicationContext())){
//authorize the user.
facebook.authorize(this, PERMISSIONS, Facebook.FORCE_DIALOG_AUTH, new DialogListener() {
#Override
public void onComplete(Bundle values) {
Toast.makeText(getApplicationContext(), "Successfully Logged In to facebook!", Toast.LENGTH_LONG).show();
}
#Override
public void onCancel() {}
#Override
public void onFacebookError(com.facebook.android.FacebookError e) {
e.printStackTrace();
if(facebook.isSessionValid()){
Toast.makeText(getApplicationContext(), "Successfully Logged in to Facebook!", Toast.LENGTH_LONG).show();
// download the users avatar
}
else{
Log.e("FACEBOOK FAIL", "Facebook has epicly failed with an error in onCreate in Social Sharing or you are logged in already");
}
}
#Override
public void onError(com.facebook.android.DialogError e) {
// TODO Auto-generated method stub
}
});
} else { save(facebook, getApplicationContext()); }
}
I do not get an error. It appears to work but does not appear on my wall.
I get a facebook response with a post id too... The application is not blocked from posting on my profile.
Im at my wits end trying to figure out the issue. Any help would be great!.
I get a facebook response with a post id too...
What response do you get if you try to look up your post via that id?
If you can see your post this way, then it’s just not displayed on your wall (for reasons such as hiding/deleting previous posts, negative app feedback, …)

Categories

Resources