how to make Several facebook links on site to open in facebook native app and auto generate the facebook profile or page numeric id
<p>i have the below android code for Facebook link to open in the native Facebook application. it is working fine but only for the profile id which is given here <code>url = "fb://profile/100012746891816";</code> .
Please if somebody can help and edit my code and make it working for several Facebook profiles or pages on the website and generates the Facebook id automatically.</p>

<p>here is how im linking through php <code>&lt;a href="&lt;?php echo "http://facebook.com/".$fbk; ?&gt;"&gt;</code> the <code>$fbk</code> contains Facebook page or profile name.</p>

<pre><code>if (url.contains("http://facebook.com")) {
    Uri uri = Uri.parse(url);
    try {
        url = "fb://profile/100012746891816";
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
        startActivity(intent);
    } catch(Exception e) {
        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
    }
    return true;
}
</code></pre>