WHy my URl gives disalowed characters error? - android

I am trying to build an android app for which i was going through the hackerrank api documentation. This is the general format of the request to be made :
api.hackerrank.com/checker/submission.json -d 'source=print 1&lang=5&testcases=["1"]&api_key=yourapikeyfoobarbaz'
I pasted my key and made the request but got the error "The URI you submitted has disallowed characters"
The documentation however shows that proper response has been obtained.
This is the link to the documentation : https://www.hackerrank.com/api/docs
Since i am new to android development i am not able to figure out my fault. Can someone please guide me.

Related

Android app to get .aspx form response

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).

500 Server Error using Python

Please bear with me as I am a complete noob and trying to create a database for my app using App Inventor.
According to Google App Launcher, I have successfully created my app. However, when I load mcdougaltextspeak.appspot.com into my browser, I get the following message:
Error: Server Error
The server encountered an error and could not complete your request.
If the problem persists, please report your problem and mention this error message and the query that caused it.
I am following the directions provided on http://appinventorapi.com/program-an-api-python/ and I'm sure my issue is because I am not correctly modifying the default app.ymal file
Here's what I have according to the directions:
application: textspeakedtech597
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /images
static_dir: images
- url: .*
script: main.py
I initially just changed myapp to mcdougaltextspeak, however I got a message that I needed to modify the code for python 2.7 according to this site:
https://developers.google.com/appengine/docs/python/python25/migrate27
This site also included modifications for other things, so I am wondering if my error stems from this. The directions do not make note of modifying any other code. Do I need to modify/add the code that appears on the migrate to python 2.7 page (see above link) and if so where does it go.
My app is stuck without a location to hold data.
Any advice on how to proceed is greatly appreciated.
Have you actually created an app on https://appengine.google.com?! You need to do that first, then your app.yaml should contain the appid that you have created i.e. application: mcdougaltextspeak & not what it is in the tutorial.
After you've edited the app as you want, you must then deploy the app to the Google App Engine Servers (refer to the GUI deploy). You would get detailed logs when deploying, which would tell if the deployment was successful or not.
After deploying, you can then goto https://mcdougaltextspeak.appspot.com & play around with your online app. If you still get errors, check https://appengine.google.com/dashboard?&app_id=mcdougaltextspeak for the logs & report them here.

jsOAuth PhoneGap and Android

I searched SE's archives, google, directly ripped this off and ran it and I've been on it for like 6 hours now.
Based on the link above (jsOAuth Library) I wrote my code and when I run it on my android, the inAppBrowser (correctly) redirects me to the twitter page where I'm supposed to get my pin. But instead of the pin, it shows "there is no request token for this page... " error.
I even deleted and registered a new app under a different name and got a new pair of Consumer key/secret. But that too did not budge.
This could be a possible solution but even the Boilerplate example is not working. I guess I'm not getting my request token. Any help?

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.

Android + Facebook SDK + "message" property is now ignored?

I'm learning the FB api and I need assistance with one issue. I'm attempting to prepopulate the message with data from my application. Seems the message property is now ignored. Can some offer me a solution to this issue? I've read somewhere that creating your own dialog and using facebook.request(path, bundleWithMessage, "POST"); would do the trick. Can someone post a snippet for me to see? I'm researching the docs, but don't see examples, and I'm not sure what path refers too, assuming the graph-api. Sorry for the noob question, any help is appreciated.
On July 12, we are ignoring the message parameter in Feed Dialogs. This eliminates the ability to pre-fill stream stories (prohibited by Policy IV.2).
https://developers.facebook.com/blog/post/510/

Categories

Resources