Android: post to a password protected server - android

I am trying to send information from my Android device to my php server. I followed this tutorial (http://www.codeofaninja.com/2013/04/android-http-client.html), but then realized there is nowhere to specify my useID and password to log into the server. a lot of search but could not get anywhere. I am new to both Android and Apache. Please advice, thanks.

well, i have to learn to ask the right question or enter the right words to search. i finally found with this post and got my answer.
Android HttpClient authentication always returns 401 code

Related

How to check how many topics has been subscribed?

I want to identify how many topics a single device is subscribed to. Then I found and followed this post. I don't know if I follow it right because i receive this message
{"error":"MissingAuthorization"}"
Here are the steps:
Get token from the device
Generate a URL: https://iid.googleapis.com/iid/info/<paste token here>
Copy-paste the URL to the browser
Get the response.
I don't know if I'm doing something wrong. I hope someone can help me solve this problem.
It's saying that there is no authorization specified. Make sure you're including the Authorization:key=<Server API key here> in your request, where the Server Key is the one found in your Firebase Console, under Cloud Messaing tab.
Yeah this how you check Add the KEY=
U forgetting to put the Authorization starting with "KEY=BLALALALALA"
Authorization

android:--java.net.ProtocolException:Too many follow-up requests:21

I am trying to sync my app with the server (periodically,on-demand & when network outage happens),which uses the basic authentication for the syncing.Here i am facing this error.
Had done some research on this but found no solution.Have anyone come across this & have a solution???
PS:I am a novice developer in android.
I recommend double checking the method url that you are using.
For instance, can you run it using Postman or some other REST client and get a valid response?
This behavior happened in one of my project while I accidentally used a broken method URL but with a right host.
good luck:)

Google Safe Browsing API v2 sample Implementation Android

I am trying to implement a Sample application in Android which gets the malware and phishing list from safe Browsing API and checks the authenticity of URL, this is client side method, but I am constantly getting 400 (Bad Request) as response code when I am trying to hit the URL.
Searched throughout the internet but couldn't get any sample working code.
Even on Developer's Guide page https://developers.google.com/safe-browsing/developers_guide_v2 it is not mentioned how to send the list name correctly in POST request for downloading or updating.
Please help me by providing the correct procedure of how to send list name (if code snippet can be posted, it would be great as I am new to Android.)
Check out that request should end with '\n'. It is common to ignore this. I hope it helps.

Android DefaultHttpClient Cookies with comma in the value

I'm trying to use the DefaultHttpClient in an Android app I've had for sometime. The server I've been authenticating through recently changed some of their stuff and so it broke my app. I've been trying to figure out why, and I think it's related to their having commas in a cookie value they send me; the sysadmin I'm working with was able to show me a value I should have had and I saw the value my app is getting by printing the cookies out to the log. What he sent me:
Cookie: LastMRH_Session=f9d0e6b4; MRHSession=2ab4fe11c9258eb12ebe60d6f9d0e6b4; F5_ST=1,1,1,1346792510,604800; ...
What I got in my logs was just F5_ST and 1 when I printed name and value.
Has anyone run into this before or have an idea of what to do?
well didnt fix the problem I was having, but I got the entire cookie to be used right by:
params.setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.NETSCAPE);
not sure the implications for the rest of my connections, but it seems to give me the whole cookie back now at least.

posting to app page

I have an app fb page and would like to be able to post messages on it. I am currently able to get my android code to post a msg to my own wall but I want to be able to post to my app page also.
Is this possible?
Do you have to be a member of the page also?
thanks
In the documentation (http://developers.facebook.com/docs/reference/api/page/#feed) it says:
feed
This connection corresponds to the Page's Wall. You can create a link,
post or status message by issuing an HTTP POST request to the
PAGE_ID/feed connection. To see more details please see links, posts,
and status messages documentation.
This official blog post (http://developers.facebook.com/blog/post/465/) shows how to do so with php, and a normal post request using curl, you can use that to create a java code for android.

Categories

Resources