To work with the Facebook API you have to load the Facebook JavaScript SDK, initialize your Facebook application, authenticate the user and request an access token to then send the final Facebook API calls. In this long process chain much can go wrong. Especially because the calls happen all asnychron. You have to work with the correct callback mechanisms to reach the goal. To hide this mechanism and to make the Facebook API easier to use, I have created an abstraction, with which you can work much easier, as you can see here:
<script src="./js/simple-facebook.js"></script> <script> // Setup var fb = new SimpleFacebook(); fb.setAppId('255100001240698'); fb.setLocale('de_DE'); fb.setPermissions('email,user_about_me,friends_about_me,publish_actions'); // Usage fb.showUsersName(); fb.showUsersLink(); </script>
Doesn’t it look great? No more need to include a …weiterlesenfb-root tag or many JavaScript snippets. All you need is the simple-facebook.js file, which can be expanded depending on your needs. Here is a basic version, which illustrates the concept:
If you authenticated a user with the Facebook JavaScript SDK, then you can do the following to get the ID, name and email address of a user:
FB.api('/me',function(response){alert(response.id);}); FB.api('/me',function(response){alert(response.name);}); FB.api('/me',function(response){alert(response.email);});
Over the years many ways have been created in order to authenticate through Facebook. One of the easiest ways is to use the Facebook Markup Language (FBML). However, from January 2012 is FBML is no longer supported. Who wants to use Facebook Connect to login and logout then, should use the JavaScript SDK provided by Facebook. This supports authentication via OAuth 2.0, which is the recommended way to handle authentication. I programmed an example, that shows how to login and logout with the JavaScript SDK. This example is based on the current JavaScript SDK methods and does not use deprecated methods (because in July 2011 there were some changes). …weiterlesen
Als ich die Datei ddms.bat aus dem /tools/-Ordner des Android SDK aufrufen wollte, bekam ich die Fehlermeldung: “Failed to get the adb version: Cannot run program "adb": CreateProcess error=2.
Um diesen Fehler zu beheben, musste ich alle Dateien aus dem Ordner C:\Program Files\Android\android-sdk-windows\platform-tools\ nach C:\Program Files\Android\android-sdk-windows\tools\ kopieren.
Dadurch wurde auch die Fehlermeldung “Failed to parse the output of 'adb version'” behoben.
Achtung!
Der nachfolgende Beitrag ist vom 13. Juli 2010 und bezieht sich auf NetBeans 6.9.1 sowie nbandroid Version 0.1 Inzwischen sind viel aktuellere Versionen erschienen, weshalb dieser Beitrag nicht mehr zeitgemäß ist. Die Android-Installation in NetBeans 7.0 ist viel einfacher geworden. Mehr Infos dazu auf How to install Android plugin version 1.x into NetBeans.
Vor einigen Wochen habe ich mich mit einem HTC Hero der Androiden-Föderation angeschlossen. Als Programmierer ist es damit für mich zur Pflicht geworden, eine Android App zu entwickeln. Doch bevor man damit beginnen kann, muss man das Android Software Development Kit installieren. Außerdem bietet es sich an, dass Android SDK mit einer integrierte Entwicklungsumgebung zu koppeln. Ich habe mich für die Kopplung mit dem neuen NetBeans 6.9 entscheiden. Wie das funktioniert, steht im weiteren Verlauf. …weiterlesen

0