Android Question Help with facebook

Douglas Farias

Expert
Licensed User
Longtime User
hi all
how can i make a app to get facebook informations?

for exemple you open the app and u need log on with facebook

later you log on it show u

Photo:
your name is:
years:
country:

it is very hard to make?
remember i m not programer xD
 

Douglas Farias

Expert
Licensed User
Longtime User
anyone?

i realy dont know how to make =(
i m trying to make in javescript but in the basic4android i dont know
i need make this

exemple1
http://graph.facebook.com/douglas.farias.3152

exemple2
http://likeapps.net/1.php need click in login image


i need this on basic4android app

user can login and later he log on show
profile photo
name
etc
etc
in the app not in the webview

name = string
etc

how can i make this?



here is my code javascript
B4X:
<?php
  
      if(isset($_GET['fblogin'])){
          
              if(isset($_POST)){
                  
                  
                    IF ($_POST['locale'] == "us")
                    {
                    $a="USA";  
                        }
                    else
                    {
                    $a="BRASIL";
                    }
  
                  
                    if($_POST['gender'] == "male") // or if(call())
                    {
                    $b="Homem";  
                        }
                    else
                    {
                    $b="Mulher";
                    }
                  


                      $msg="<img src='//graph.facebook.com/{$_POST['id']}/picture'> <br>
                      <b>Nome</b> <a href='//fb.com/{$_POST['username']}'>{$_POST['name']}</a>
                      <br><b>Email</b> {$_POST['email']}
                      <br><b>ID</b>  {$_POST['id']}
                      <BR><b>USERNAME</b> {$_POST['username']}
                      <br><b>SEXO </b>  $b
                      <br><b>LOCALIDADE </b> $a
                      ";

                        echo $msg;
    
                }
            
        }
?>
<html>
<head>

<head>





<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script>
/**    Login Js Sdk by: carafeio      */
window.fbAsyncInit = function(){
Facebook={id:"my key here",url:"www.likeapps.net"};
        FB.init({
                appId      : Facebook.id,
                channelUrl : '//'+Facebook.url+'/channel.html',
                status    : true,
                cookie    : true,
                xfbml      : true
        });
};
(function(d){var js,id='facebook-jssdk',ref=d.getElementsByTagName('script')[0];if(d.getElementById(id)){return;}js=d.createElement('script');js.id=id;js.async=true;js.src="//connect.facebook.net/en_US/all.js";ref.parentNode.insertBefore(js,ref);}(document));
$(function carrega(){
    
        $("img,#casa").click(function(){
            
                FB.login(function(response) {
              
                        FB.api('/me', {fields: 'email,id,username,name,gender,locale'}, function(response) {
                                $("#loadfbLogin").load('1.php?fblogin',response);
                        });
                }, {scope: 'email'});
            
        });
    
});
</script>



</head>
<body>
<div id="fb-root"></div>
        <center>
                <img src="http://vsurvivor.com/images/login_with_facebook.png" width="450">
                <a href="#" id="casa">TESTE </a>
                <div id="loadfbLogin"></div>
        </center>
</body>
</html>
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…