FriendPickerSample doesn't show my friends - java

I am testing this sample from the Facebook SDK, but don't appear any friends... it says: " "
When I click Pick Friends, a pop up window shows:
" FriendPickerSample would like to access your public profile and friend list"
And I click "OK", but nothing happens it keeps showing only the string ""
Do you guys have any clue?

Problem solved, I didn't had the key hash registed on facebook app developer, neither had the app_id on the strings xml file.
Thanks all anyways

Related

Logs in Android Studio

I am a newbie of Android Studio.
I have a problem with display the logs in my app.
For example:
String timeStamp = new
SimpleDateFormat("yyyyMMdd_HHmmss").format(Calendar.getInstance().getTime());
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cycle);
TextView textView = (TextView) findViewById(R.id.cykleoncreate);
Log.d("[ " + timeStamp + "]", "[onCreate]");
I only want to display this log in my app. How can I do it?
you can display the logs by Toast or set in textView
Toast.makeText(getApplicationContext(),timeStamp,Toast.LENGTH_SHORT).show();
or
textView.setText(timeStamp);
What you have done is write but you can get confused as in where's the log, Log has tag and message, Tags are usually Activity or fragment name so that its easier for one to locate from where did a particular error or message came from, and you can include anything in the message part of it.
we have different types of logs this can be found here
You will find a logcat button on bottom side left side of android studio from there you can select depending on which type you want to see? in your case it's debug
Ok, it works well
textView.setText(timeStamp)
But I don't know why it doesn't work, when I want to build my string:
textView.setText(timeStamp + "my string")
Actually Log is not displaying in app , it will display in android studio . For displaying in app , we need to use Toast . your code is working fine you can check it in your android studio , as its shown in image We can display like this Log.d("onCreate", timeStamp); and search using TAG as onCreate.

Google App Script logger.log not showing anything

I writing a simple google web app. this .gs basically open a html file that require user to input his name then click. after the user clicked it, the function checkGCR() should log the username in logger.log. but nothing show in logger.log. if run the function checkGCR(), the log does record "null" since nothing input in the input box. One thing I notice is eventhough the logger.log didn't show anything, but stackdriver log doesn't showing something going on there. Please check my code is that something wrong I did here because I follow online tutorial with exact same coding but logger.log just doesn't seem to work.
//This is code.gs
function checkGCR(myid){
Logger.log(myid);
}
//This is html
document.getElementById("btn").addEventListener("click", doStuff);
function doStuff(){
var myid=document.getElementById("mykidid").value;
google.script.run.checkGCR(myid);
}
I just found out that eventhough it doesn't show up at Logger.log, but it does show up in Stackdriver log. So I just use that instead.

Posting to Facebook Via Android Does not Show Image

I am trying to implement the Facebook share functionality in my app but when I click on the share button I get the following image:
Here's the code that I am using:
ShareDialog shareDialog = new ShareDialog(ResultsActivity.this);
if (ShareDialog.canShow(ShareLinkContent.class)) {
ShareLinkContent linkContent = new ShareLinkContent.Builder()
.setQuote("Hi Guys, I have completed Level " + level + " and I scored " + score + ". Can you beat my score?")
.setContentUrl( Uri.parse("http://play.google.com/store/apps/details?id="
+ getPackageName()))
.build();
shareDialog.show(linkContent);
}
The google play link works fine and it has icon image and the necessary images.
When I was browsing for solution online, I found that Facebook OpenGraph Debugger helps in determining the cause. So, I used this link to look for any causes and Facebook was complaining about missing og:type as shown below:
What code should I add in android studio in order to fix this problem? Any help or suggestion will be greatly appreciated.
Ok, so the image finally appeared. I had to give it at least 6 hours for the image to appear. All I did was go back to the Facebook debugger link, and refresh my play store link and it showed me a preview with the image.
So if anyone is facing the same issue, please be patient. :)

SendKeys(Keys.Enter) not working in Appium

I have entered text in a text box. And now I want to press Enter key. To do that, I am passing sendKey(Keys.Enter) which just cut the text from the text box and does nothing.
driver.findMobileElement("id", setLocationTextBoxId).sendKeys(parkingLocation+"\n");
driver.getKeyboard().sendKeys(Keys.ENTER);
Note: "\n" is not working already. sendKeyEvent/pressKeyEvent method is not available.
To press ENTER key on Android device, you need to use Android KeyEvent codes. The key code for ENTER is 66. You can use the below code snippet.
driver.longPressKeyCode(66);
To get the all Android KeyEvent codes please refer this official link
Try this! I have the same problem like you, and i got frustated untill i found this. Hope this will help you out!
public void pressEnterEditText(String elementName, String value) {
AndroidElement tempElement = getAndroidElement(elementName);
tempElement.click();
driver.pressKey(new KeyEvent(AndroidKey.ENTER));
}

Android - score not being submitted to a leaderboard

Recently, I've added leaderboards to my Android project and everything worked fine until I tried to submit score to it. Google Play Services are configured correctly and I can view the leaderboard but I cannot submit
Games.Leaderboards.submitScoreImmediate(getApiClient(),String.valueOf(R.string.leaderboard_id), score);
Since i doubt error is visibe from that line and since logcat displays no data related to score submission, i am wondering how to check is the score was submitted correctly.
Thanks.
I don't know much about the score submission to the Leaderboards - but the error might be visible from your line:
String.valueOf(R.string.leaderboard_id)
is not giving you the string you specified in the some strings.xml file, but some string containing the internal android id for that String like "1234567". To get the String from the file you should use
getContext().getString(R.string.leaderboard_id)

Categories