Facebook SDK – Why onComplete is never run in case of newMeRequest, newGraphPathRequest etc.?

Imagine that you have a code used for retrieval of the user related data from Facebook account, such as:

Request request = Request.newMeRequest(session,
new Request.GraphUserCallback() {
	@Override
	public void onCompleted(GraphUser user, Response response) {
		//Code
	}

request.executeAndWait();

However the onComplete() method is never run. Up till now I have discovered four reasons for such a situation:

  • Request is not executed, i.e. Request.executeAndWait() or Request.executeAsync() are missing
  • Request.executeAsync() is used, however it is not executed on UI thread – Request.executeAndWait() should be used instead. E.g in case of LibGDX the Render() function is NOT executed on the UI thread.
  • The following line of code is missing from the Manifest.xml file
  • <uses-permission android:name="android.permission.INTERNET" />
  • onActivityResult() is not triggering the corresponding function from Facebook SDK, i.e. the following code is missing (uiHelper is of type UiLifecycleHelper which should have been created in onCreate()) :
  • @Override
    
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    	super.onActivityResult(requestCode, resultCode, data); 
    	uiHelper.onActivityResult(requestCode, resultCode, data);
    }

Please let me know if I have missed something!


←Table of contents
←My apps, games and other projects

Advertisements
Facebook SDK – Why onComplete is never run in case of newMeRequest, newGraphPathRequest etc.?

LibGDX – what it can actually do? what are its capabilities?

As a hobby/indie developer I find the most problematic not the fact that I don’t know how to code something. The bigger issue is that I am not aware what is actually possible – especially when using game engines (whose existence and ease to use was an eye opener for me). How can I google something and add it to my projects, if I don’t realize it exists in the first place?

For my puzzle game, I have decided to use LibGDX engine as it is cross-platform (i.e. with almost the same code you can deploy the game for Android, iOS, web and desktop) and uses Java.

Here is the list of things LibGDX can do that I am aware of – in laymen terms. Are you able to add anything else to the list?

Continue reading “LibGDX – what it can actually do? what are its capabilities?”

LibGDX – what it can actually do? what are its capabilities?

PHP – Retrieving app ratings from Google Play and App Store by means of parsing

For my website dedicated to promotion of less known mobile games I needed to periodically check the ratings and number of reviews of the submitted apps. When there are 10 games total it can be done manually, but what if the site gets more popular and  10 games turns to 100?

I didn’t want to spend the whole evening checking whether the games still meet the site requirements.

Please continue reading to find out how it can be done automatically by means of parsing. Unfortunately Windows Phone store has protections that prevent this method from working without additional workarounds.

Continue reading “PHP – Retrieving app ratings from Google Play and App Store by means of parsing”

PHP – Retrieving app ratings from Google Play and App Store by means of parsing

Android – Playing sounds and running a code after finishing

Place all your sound files in .mp3 format in the \res\raw folder – use only small letters and no spaces in the names. Here are the sounds I have used for Flexi Dice, my custom dice roller:

Playing sounds

Continue reading “Android – Playing sounds and running a code after finishing”

Android – Playing sounds and running a code after finishing

Libgdx – drawing text using truetype fonts

As mentioned in one of the previous posts, in Libgdx you cannot just write – print “Hello World”, in Times New Roman, size 12. You need bitmaps for each of the letters.

One way to create such bitmaps is to use FreeTypeFontGenerator which comes in Libgdx package.

Continue reading “Libgdx – drawing text using truetype fonts”

Libgdx – drawing text using truetype fonts