Android app to get .aspx form response - android

I'm new to Android development. I'm working on an app for use at work - I'm an EMT. I was hoping to use the state's registry as a means of authenticating the user as an active provider. https://ems.health.state.pa.us/emsreg/activepractitioners.aspx
I know nothing of asp, except that I should be able to pass some input through the URL with ?name=value. But when I inspect the element of the last name field...
input name="_ctl0:_ctl0:SessionLinkBar:Content:tbxLName" type="text"
id="_ctl0__ctl0_SessionLinkBar_Content_tbxLName"
I can't use this. Honestly not even sure what I'm looking at here. Is ":" a container?
Ultimately I'd like to take the user input on 2 edit texts (last name & certification #), click a button to POST them to the activepractitioners.aspx, and either get the whole response and pare down for what I need (Status Active, which I've yet to find labeled on the site) or verify the response then query its label.
I've tried a few of the methods here and I keep crashing the emulator. Also I'd rather not see all the strikethroughs in Android Studio from deprecated methods. I welcome all help, but please remember I'm a n00b - take it slow for me. Thanks!
UPDATE:
I've gotten some results using JSoup. I get to a landing page that should contain just one result (the certification # is unique) and a link. The format of the link is as follows:
<a id="_ctl0__ctl0_SessionLinkBar_Content_dgSearchResults__ctl2_lnk" href="javascript:__doPostBack('_ctl0$_ctl0$SessionLinkBar$Content$dgSearchResults$_ctl2$lnk','')">
It uses javascript to invoke "doPostBack." Any idea on how to automate this too? As it is I can parse the response to a document and scrape the table for the word "active." But I'd like a bit of fool-proofing. Thanks in advance!

Since you are new to Android dev, I suggest you to spend some time having a look to Google Android Volley APIs.
It allows you to easily set up GET and POST requests (and works great).

Related

What to put for website when registering android app with instagram api?

I am new to Android and am confused on what to put for the URL fields when registering a new client with the Instagram API using their web form.
I'm specifically confused as to what to put for these fields:
Website URL
Valid Redirect URIs
I am making an Android app and it doesn't have a website, so what am I supposed to be putting here?
In my search for an answer that made sense to me, I found this: http://oferei.com/2013/06/serverless-instagram-authentication/
In short, this is what one would need to know about how to fill these fields if they are registering an app that does not have its own website:
Website URL: it doesn't matter what value goes here, I used localhost
Redirect URIs: The article above specifies a custom URI scheme, but this is not supported w/ the Instagram API anymore. However, I did see that also using localhost would work here as well in this article: http://jelled.com/instagram/access-token
Not sure if that is the best practice, but it is a way to get the client ID for an Android app.

can't authorise moves through app link

We are developing an app that should get data from the Moves app API.
When authorising our app on the mobile phone, we manage to do so successfully in the case in which we submit the PIN provided by the desktop link into the moves app:
https://api.moves-app.com/oauth/v1/authorize?response_type=code&client_id=<client_id>&scope=<scope>&state=<state>
In the case where I use the Mobile website / app link instead, this won't work:
moves://app/authorize?client_id=<client_id>&scope=activity%20location&state=<state>&redirect_uri=<redirect_uri>
Note: <redirect_uri>==encodeURIComponent("mymovesconnector:8081/callback").
The response we get from the Moves API is 400: {"error":"invalid_grant"}.
From the docs, it says that invalid_grant can happen if either:
the code in the request is not valid or
the code has expired (it’s valid for 5 minutes currently) or
the code has been revoked, because it was already used in an access token request (both successful and unsuccessful requests will revoke the code) or
you are missing the redirect_uri parameter when it’s required.
My checklist:
I guess this could have happened, but how/why should this code, provided over moves://, be different than the one provided through the https:// request? What control do I have over this?
not my case, since I'm using the code right away within less then a few seconds
if this might have happened, where could it happen other than through the redirect url?
I'm providing it always. It's always the same - also in the app settings on moves.
Can't figure out what I'm missing. Went through the docs many times, step by step. No success.
While writing down my question, I managed to figure out a solution to this problem.
The docs don't point out that response_type=code might also be used for the moves:// link. I tried to add this parameter, and it worked!
Note: this has been tested on a virtual android device only (Genymotion).

Post a message with special characters on Facebook through Temboo

In my Android app I use the Temboo library to post on user's Facebook wall. Everything is OK except when the message contains non-ASCII characters. For example, if I try to publish the String "Oído", I get on Facebook: "O�do". I suppose I would need to set the charset for the Temboo library (if UTF-8 is not the default charset), but I find nothing on the documentation or I am missing something.
I work at Temboo. We made some updates based on your question so encoding should work fine for you now. Please try again and let me know if you're still seeing the issue.
If you ever want to ask us questions directly, the best approach is to contact us via email:
support#temboo.com
We're always available and happy to help.

AppRequest Dialog does not appear

i am currently building a game with Unity for Android.
I want to use the AppRequest feature from the Facebook API.
User should be able to challenge their friends.
I implemented it just like in the tutorial (https://developers.facebook.com/docs/unity/reference/current/FB.Apprequest)
FB.AppRequest(
message:"message",
title:"title",
callback: appRequestCallback);
I have the following permissions:
basic_info
publish_actions (to post the score)
friends_games_activity (to see the scores of the friends)
And yes, I am logged in. I check that directly before that.
I tested it with development mode on and off.
If I run the game on Android and click the button that calls the method, Facebook tries to load something, but it will never appear. I see the load-icon (this turning circle thing) but nothing appears and I am back in my game. It looks like everything is directly cancelled.
If I run the game in the Unity Editor everyhing works just fine. I can see my friends and send them requets.
What am I missing? It's driving me crazy.
Do I need another permission?
Everything else works perfectly with the FB SDK.
I have encountered a similar problem with Facebook Unity SDK, which was solved by passing more parameters - these marked as optional too.
It shouldn't work like that, but they're still working on that plugin, so maybe you could give it a try, and specify all parameters you can, or manually pass them default values.
I found the solution.
I passed to many characters in the message and title strings.
Therefore my question was maybe misleading, because I replaced the strings with short dummy values.
If you encouter a similar issue:
The length of message should be at most 60 characters.
The length of title should be at most 50 characters.
I tried it on another phone got an error message there. On my phone the dialog just did not appear.

HTTP response code -1 on android phone - using appinventor

I am building a simple search app through MIT AppInventor. I have had no problems in querying my spreadsheet shared as public on the cloud.
Suddenly, for no reason, my GET request to the HTTP fails with a response code of -1. I have looked everywhere but can't find an explanation for this -1 code.
Let me repeat that the same block of codes was working perfectly fine until this happened. Now I can't figure out what is going wrong. Any help will be much appreciated.
I solved this problem when I found out that my target spreadsheet link, which used to start with http:// was changed to https://. I found that my browser redirected me to https:// when I tried to run my query directly on the web. So changing that in my code fixed the issue.
I came across a similar issue recently. It used to work and I found out that my get request was being redirected to a login page being the session had expired.
I suggest you open the get request using the webviewer component (or activitystarter) to give you a better understanding of where the error is coming from.

Categories

Resources