Binding a web page's element to an Android App - javascript

There is a website which has a login screen, and when the submit is hit, it goes to a new page and logs in the user.
Here's a screenshot :
Now, Suppose I have a similar login screen in my android app, like this :
Now, Is there a way to link both of them, so that, when I hit login in the android app, it actually registers a submit at that website and logs in the user, and obviously, then again, binding the next webpage that shows up after logging in. How dlink the urlfrom the webpage to the js and elements in an android app?
I know there has to be javascript, but how?

Have you Checked this : http://developer.android.com/guide/webapps/webview.html
and this : http://www.codeproject.com/Articles/392603/Android-addJavaScriptInterface

While login we sends the form data from Android application to the Server-side page (JSP, Servlet,ASP or PHP), then those page will compile the required operation for login validation using any database , then it returns “1” if the login is valid else return “0”.
Hence you have to find out all the parameters that are working around once you click the login or register in that website.Also login page may contain cookies and other temp storage that will be required at each login.Also you need to find the methods used.
So understanding the webpage configurations ,parameters and functionality will help you achieve using android tools like webview(just a tool,not logic).
First make a detailed study on all the required parameters and functionality of the webpage then get started with the app.
Below is a list of reference links that may help you to tackle the issue :
Refer 1,
Refer 2,
Refer 3,
Refer 4,
Refer 5

You can also see this site to solve ur probelm ...
https://wowjava.wordpress.com/2011/01/16/login-application-for-android/
or
http://webdesignergeeks.com/mobile/android/android-login-authentication-with-remote-db/

Related

How do I get the "publish_actions" permission to work with the JavaScript Facebook API?

I have an application and am trying to connect with:
FB.login(statusChangeAfterLogin,
{ scope:"public_profile,email,user_friends,publish_actions" });
However, it looks like the publish_actions gets totally ignored.
That is, our application is able to get the public profile information, the email, and user friend list, but it is not able to share a dynamically generate image.
I tried to break the login in two steps as in:
// first login when initializing (no publish_actions)
FB.login(statusChangeAfterLogin,
{ scope:"public_profile,email,user_friends" });
// second login when user is ready to share (just publish_actions)
FB.login(statusChangeAfterLogin,
{ scope:"publish_actions" });
However, it looks like the second action does absolutely nothing.
I'm not able to understand why I am supposed to do to allow the sharing without first having the publish_actions in the scope. I can see that it appears in the list of GET variables and includes all the parameters as expected, but the second login just opens a popup, close it, and done.
All the other permissions don´t need review, but publish_actions does. I assume you are not trying as a user with a role in the App. Read about Login Review: https://developers.facebook.com/docs/facebook-login/review
publish_actions only works for users with a role in the App, you need to go through the review process in order to make it available for everyone else.

Log In with PayPal button JavaScript code builder validation error

Sorry for the basic questions but as a very first step I'm just trying to test the "Log In with PayPal button JavaScript code builder".
I've created an app, gone to this button builder, set the return URL to my localhost and then as that failed to a public website (http://bbc.com) making the same settings on my app details page but whatever I do when clicking the button I get the following error:
"Relying Party Validation error: redirect_uri provided in the request does not match with the registered redirect_uri. Please check the request."
I've tried setting the button up for sandbox and production but both fail.
Has anyone had the same issue? I'm guessing I'm doing something really stupid. I'm just taking the "Dynamically generated JavaScript" code and adding it to an empty webpage.
Thanks.
Turns out it takes a while (a few hours) for the PayPal API to update to changes in the admin console. Changes were reflected after several hours, very unhelpful for testing. That was using the production option. Even when return_uri was being recognised as correct the scope settings were invalid despite selecting all the correct options.

Can't login to Instagram using Client-Side (Implicit) Authentication

I'm trying to build a client-side application that allows people to login with their Instagram accounts. Problem is, I'm not sure if that's still possible.
I've coded a sample JavaScript after reading "Client-Side (Implicit) Authentication" section of their related docs.
I'm getting the following error:
{
"code": 400,
"error_type": "OAuthException",
"error_message": "JS login temporarily disabled"
}
From the error message I'm guessing it's not about my code but it's something on Instagram's side. Is there a way for me to do client-side login? Also, if I can't, what are my options?
Thanks.
I had similar issue and this is how I fixed it.
You have to uncheck the "Disable implicit OAuth:" by going to :
-> Manage Clients
-> Click edit on the app/webapp.
-> Uncheck - Disable implicit OAuth:
-> Update the settings and try to run it again by going to the link :
https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token
In the link, replace the values that were provided to you and in the response_type, give value as token to get the access token and if you want to get the request code, just replace token with the code in the URL.
Hope this helps for you and for future viewers.. Good luck.. :)
Just unset the "Disable implicit OAuth:" in app settings.
So, it seems it's impossible to do JS login at the moment with Instagram.
But they still allow implicit redirects so the solution is to have a server to make a redirect to your client side application. You only need two endpoints. I've written a small Node.JS app for this which you can find here.
I had tried for the same,I think there are not still providing any api to login with Instagram credentials username and password,You can just authenticate your account via
https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code

Facebook Feed Dialog: Post not showing up on friend's wall even though I get a response id

I am creating an app on facebook and I am trying to post to a friend's wall. I'm using the facebook javascript SDK and the FB.ui method to do this. In short here is my code:
function test() {
var obj = {
method: 'feed',
to: '######'
};
function callback(response) {
alert(response['post_id']);
}
FB.ui(obj, callback);
}
Note that I made this code very simple for testing purposes.
When I run it, a facebook feed dialog opens correctly and at the top says "Post Story to friendsname's Wall". I type in a message and press Share. My alert pops up with a response['post_id'] number. Because there is a response['post_id'] the story should've been posted successfully right? However when I navigate to the friend's wall there is no story. I've tried this multiple times in slightly different ways and haven't been able to get it to work. If I remove the 'to' parameter and simply post to my own wall it -does- work. So for some reason, posting to a friend's wall breaks it?
I know it's a rather broad question but I was wondering if anybody had any ideas why this doesn't work. Thanks
I suspect the problem may be because your application is in sandbox mode - https://developers.facebook.com/docs/ApplicationSecurity/
When testing your apps, place them into Sandbox Mode. This hides your
app entirely from all users who you have not authorized in the
developer app to see the app, for the roles described below. Please
note that when your app is in Sandbox Mode, you cannot call any API
calls on behalf of users who cannot see your app.
Basically, if your application is in sandbox mode, nothing your application does can be seen by users who have not authorized your application or by users that have not been specifically listed in the "roles" within your applications settings.
Remove you application from sandbox mode or add some users to specific "roles" within your application.

Is it possible to use an existing Facebook Connect session with Facebooker?

Update: Working as designed once I cleared my cookies. Doh!
I'm working on an app that for various reasons uses the Facebook
Javascript API to initiate a Facebook connect session. I'd like to be
able to use that session in a few rails methods using Facebooker.
The basic workflow is like this:
User goes to non-rails page and logs in to FB Connect via JS
User goes to another non-rails page and can view FB data such as
name, profile pic
User goes to a rails based page - rails uses session created in
step 1 to do some processing
My problem is in step 3. Facebooker detects the session fine, but when
I try to call a method like facebook_session.user.name I get: Session
key invalid or no longer valid
If I go back to the url in step two, my session still works fine.
So is this a fundamental incompatibility, or is there some data I can
send to facebooker so that I can hook into the correct session? Maybe
my facebooker.yml needs tweaking?
Any thoughts are appreciated.
My facebooker.yml
development:
api_key: redacted
secret_key: redacted
canvas_page_name: blah_blah
callback_url: http://test.domain:3000
pretty_errors: true
set_asset_host_to_callback_url: true
tunnel:
public_host_username:
public_host:
public_port: 4007
local_port: 3000
server_alive_interval: 0
Gah! Always clear your cookies before posting on the interweb people.
The problem was with an existing facebooker-based session that was still around in my browser.
All working now.

Categories

Resources