How to retrieve JSON data from a url and show them in a list view in Windows Phone 7.1 - windows-phone-7.1

I use the following URL for calling JSON data to my windows phone application.
http://rdeshapriya.com/vnotifications/webService.php?action=getLeaveNotifications
But I can't call the JSON objects in the URL and view the data in a Listbox in Windows phone 7.1 application. Please help me.

You need to download the json file and parse.
When you have data you can fill a list on WP

Related

using iTunes lookup with apps that are not on the store yet

I am using the URL
http://itunes.apple.com/lookup?bundleId=com.myCompany.myApp
to get a JSON file with the information about my app. This works if the app is already published on the App Store but I am still developing it and the result coming from that URL contains just this:
{
"resultCount":0,
"results": []
}
I have tried to use
http://sandbox.itunes.apple.com/lookup?bundleId=com.myCompany.myApp
and
https://sandbox.itunes.apple.com/lookup?bundleId=com.myCompany.myApp
and I receive
Http/1.1 Service Unavailable
Any ideas?
It's not possible to do that. I'd suggest using another way to get the data you need or mocking the response you expect while the app isn't available and forward the request to Apple as soon as data is available.

Calling Ajax in an iPhone app

I'm creating an iOS native app version of a web app that uses jQuery to fetch information from its database. Is there a way to make an ajax call in iOS that returns a JSON object?
You're going to want to take a look at NSURLSessionDataTask. This will return JSON as an NSData object . Here is a link to the docs.
If you want to make the request asyncronously, NSURLConnection class here.

Show Facebook Wall of Page in iOS

i am currently working on an App and i want to show the Posts of a Facebook Page in a TableView in iOS. What I read before was I can get the Data from https://graph.facebook.com/106407802732665/feed?access_token=ACCESS_TOKEN .
I know I have to parse the JSON and put it into the TableView.
But I don't know how to do that.
you first parse JSON and get data for facebook feed,it have more data with keys,you use required keys and customize your table view cells. refer this example code
parse json ios programming tutorial
iphone ios json parsing tutorial

how to use jquery mobile asp.net mvc 4 to download and display pdf memory stream data

I have a desktop/mobile web app that needs to display a pdf stream on the target device. I now have this working on the desktop using the jquery dialog. For mobile tho...my html View page has the following link:
View PDF
And that correctly takes me into the Controller Action:
public ActionResult PdfView(string id = "")
{
PayStubDataEntity ps = PayStubAccess.GetPayStubByID(new Guid(id), new Guid(Session["Session_Application_UserID"].ToString()));
WebHelper.SetHeadersForDownload(System.Web.HttpContext.Current.Response, "application/pdf", "PayStub.pdf", false);
MemoryStream pdfMemoryStream = SendPayStubToBrowserAsPdf(ps);
//WebHelper.SendFile(System.Web.HttpContext.Current.Response, "application/pdf", "PayStub.pdf", false, pdfMemoryStream);
return File(pdfMemoryStream, "application/pdf");
}
But nothing ever shows up on my iphone emulator (electric plum). No error messages. I am not sure where the output s/b going or how to view it? Any ideas would be most appreciated.
We have this same issue with android phones and there can be two issues going on. If the website uses ssl and the phone you are on does not accept it as a valid ssl, it will say downloading pdf in the manager, but it never completes a download.
The second issue is the file you are sending to the phone needs to be named in order to download properly to the phone.
Ex: return File(pdfMemoryStream, "application/pdf", fileDownloadName:"PayStub.pdf");
I would suggest using Google Chrome for phone emulation. When you change the settings, it will behave similarly to the phone and you can debug easily.
For example, when I set Google Chrome to the mobile phone user agent Android 4.0.2, it will download the pdf, instead of displaying within the web browser. When it does that, I know it is working locally. It also has iPhone emulation.

Direct file download vs reading a file back as download

Is there any difference between creating a direct link to a file on a server, and doing something like reading the file from a location and setting the content type header then streaming back the data.
I'm curious because I have a webserver that i'm using to download apps to a blackberry, if i create a file and have a direct link to that file it works, but if i stream it back using an webpage it doesn't work. The phone gets the file but it doesn't work.
Things to note:
urls are the same in both cases ie (http://somesite.com/download/file.jad)
in a browser using fiddler the downloads/header are exactly the same byte for byte
So why would the phone prefer a file that's actually a direct link vs one that is a controller streaming the data back when the data transmitted and the url are identical?
The .JAD file is just the first part of the download - there are also the .COD files associated with it (referenced in the JAD). Did you ensure that your "streaming" method is sending back the COD file correctly and with the correct MIME types?
I discovered a fix for this problem though I'm still not sure what causes it. I have been delivering the link to the phone through the sms/email gateway. When the phone gets the sms and I select the link for download it asks if i want to get the jad i hit yes and it shows up and drop out. I put the exact same link on another page as an html link and sent an sms pointing to that page. The web site throws an error... So I copied and pasted the link into the phones browser and the page shows up just fine, I click the jad download link on the page and now the jad works fine.
So i'm thinking two things either there is some sort of security mechanism that prevents direct links in sms(but this has worked for other files) Or the way the phone gets the url is different.
I ran some tests and noticed something else, on a page that accepts an id value (http://site.com/download/145) where 145 is an id for a file, if you go to that link in a phone browser it works fine and you download the file. If you send it in an sms the server errors out saying that the id is expected to be a float and it received a string. So why is it that when the phone links directly from sms the url parameters are strings but when used in a browser the actually get parsed as a float?
Sorry for the long winded explanation but it's a strange issue.

Resources