Can any one please guide me on this . I am new to iphone/ipad programming.I store videos on my webserver (apache/php).I need to write code for an ipad app to get the videos list for a selected user and play those videos on the ipad/iphone using a php webservice.I was not able to get going on this.Please can anybody share any related links or shower your thoughts on this ? Any help would be highly appreciated.
Thanks
your question actually involves a lot to implement, but I'm not sure where you're right now:
Sever-side programming to expose web-service which can be invoked to
get a list of available videos. Have you done this? And what format
your server-side responses, SOAP XML or JSON?
From your iOS client side, you firstly need to establish an HTTP
request to the web-service URL entry. Have you done that? You may
want to use ASIHTTPRequest to save your effort.
Once you've got server response, depending on how the data is
presented, you may need to find a XML parser or a JSON parser to
parse the raw response.
Then you need to either download the video entirely before playback,
or stream the playback. You may again need ASIHTTPRequest for
downloading. You may need MPMoviePlayerViewController or
MPMoviePlayerController(if you want more control over the player layout) to plackback/stream the video, see:
MPMoviePlayerController and HTTP Live Streaming
And don't forget to save the playlist and user viewing history if
you want to provide a smooth user experience. You may use as simple
as NSUserDefaults/plist as the data persistence media, or as complex
as SQLite database or Core Data.
I suggest you to break down your ultimate goal into specific tasks, and tackle them one by one.
Program your web server to return a JSON object with the list of
movies. You can include preview thumbnails etc.
Include one of the JSON frameworks available (just do a quick
search, there are plenty).
Use the data from the JSON feed to display your list.
When the user clicks on an item, launch a view controller with a
UIWebView to display your movies.
If you do not know how to do any of these things, you should consider an objective-C programming tutorial first.
Related
Basically, how can I store data in a URL that can be accessed by other devices?
This would be similar to how Instagram works, where people can see the pictures that others post, even though the files are not stored locally on the user's device.
This could also be a way to create high score leaderboards in a game without using GameCenter.
Thanks in advance.
NSURLRequest class is better to use to perform request by URL. So, if you have some RESTful backend by the URL that accept POST data you will be able to push binaries. You can find code iOS example for request similar to yours by following URL - Send image to server as binary data
For the server side I would suggest to take a look into node.js direction (http://nodejs.org)
You need some form of server support, like php, asp etc.
Have a look at HTTP POST and for iOS have a look at NSURLConnection Class Reference, or even better, AFNetworking.
I have created a few small apps for the iPhone so I have some experience. An organization that I'm in asked me if I could program a weekly newsletter app for them. I though it would be a good challenge so I agreed. My question is: how do I get the app to update weekly without the users having to re-download or manually update? Do I connect to a database or a website? Can anyone send me the link to a good tutorial? I wasn't able to find one.
Thank you!
Your question is very general but I could give you some suggestions.
First, you need to connect to a service that provides you news info. This is needed. The service could send you an xml that you can parse and display, for example in a UITableView. XML is not the only solution. You could use also JSON.
For parsing XML I suggest you to read GDataXML, while for JSON JSONKit framework. But there are also other valid framework out there.
Then, to save data it depends on what kind of data you deal with. Here you could find different ways to save your news. Save an XML that contains your news, serialize data and save them in the local filesystem or use Core-Data.
To update your news without user actions, you have to save the last time when the app has downloaded news (for example in NSUserDefaults) and each time time the application is "activated" check for that date and update news if necessary.
Out there there are plenty of tutorials on how to (in parenthesis I inserted classes or framework that you could have a look):
consuming web service on iPhone (ASIHttpRequest - no more supported, NSURLConnection class, AFNetworking)
dealing with XML file/data and theirs parsing (GDataXML, touchXML, etc.)
dealing with JSON messages (JSONKit, etc.)
managing documents (NSFileManager class)
using Core-Data
using Property-List and/or NSUserDefaults
First three cover the first step (download). Other three cover the second one (save). Obviously you have not to use all of them. For example a configuration could be:
NSURLConnection for service, GDataXML for parsing XML data and Property-List for save data.
Hope it helps.
A simpler approach would be to make it a pure web app and update the website weekly.
Your content providers are going to have to do those updates anyway.
Check: Adding Newsstand Support to Your App or Tutorial: How To Make Your App Work With The Newsstand
First, Thanks for your help - I greatly appreciate it. The core solution I am trying to figure out is how to display content from a CMS inside of an iOS application. The application I am planning is a company intranet / portal used to display news, alerts, and other content to sales associates at our firm. One approach a friend suggested as build the content in HTML and display in a web view, This does not sound like the best solution too me. How do apps like Facebook, Flipboard, etc display server side content inside the applications.
The application / employee portal will consist of news stories, alerts, documents etc in text form accompanied by images, video, audio. The sales associates will use the application to navigate through the content stories, read, review, etc with all of the nice features of ios, the sliding and flipping of pages and content, etc.
The content and user roles would be managed by a CMS (Joomla, SharePoint, Storage Room, If you know of something better please let me know). The app content would also need to be accessible when offline, what is the best approach for this solution? Is there any existing code bases / libraries that I could leverage for this?
I am having trouble understanding the best process for 1) rendering / displaying the CMS content inside the the App (HTML webview or Another approach?) and 2) How do pull the content, images, video, audio down to the device for offline viewing?
Any ideas you might have will help. If you think there is a starting point set of code, or an example model we might be able to use as a starting point, please let me know.
Thanks You! I greatly appreciate any input.
This is all possible for ios app. you have to made web service for your apps. At the starting when an app is start the data are store in local database like used sqlite or core data in your app. so after that if there is no internet you can stil access your data.
A framework/product like TapLynx or Appcelerator might be a good fit for you. Look at the product demos and showcased apps to see whether they support the kind of thing you want to do.
HTML webviews are a good mechanism for displaying rich content on the device. As to whether you'll display HTML which exists in the CMS, or pull down data and format the HTML on the device, it's really up to you.
I'd go about it creating an API on the server. You can download the data as raw XML or json and parse that content into workable objects. As for how to download pictures and other data, just include the URL string for the picture in the XML / json download.
See the iOS downloading programming guide for details on how to do download data from a server.
Also, as hiren said, you can save the downloaded data using core data.
This is what I am trying to accomplish.
Capture images from iPhone
Store them on the web service
Retrieve them when required
I have searched for tutorials on the topic but have found none. Also, there are various threads providing information in bits and pieces which I am finding hard to piece together and deduce something useful from. Please post a sample code that does it.
Thanks in advance.
Sayeed
If your trying to upload to a popular web service like Flickr, you will have to read and understand their API. Whether your using one of those, or your own server, most probably you'd want to use this open-source library ASIHTTPRequest as it will provide you with a nice layer of abstraction with communicating with web services.
To capture images you can use the UIImagePickerController
To up- and download images to/from a web server you can use NSURLConnection and it's companion.
And it's always a good start to look into some apple sample codes. They're on the related classes documentation at the top under "Related sample code".
Is it possible to pull information from a website and display it in an iphone application?
I am looking to pull the current temperature and barometric pressure for an airport from the http://adds.aviationweather.noaa.gov website and display those two pieces of information in an app.
This sounds like a common task that programs do all the time but I'm not sure how it's incorporated into an app.. (what is the process of pulling webdata called?)
What methods or tools are available to do this? I am unfamiliar with handling web data for iphone at this time.
If they have an actual feed for the data, you could access it using NSHTTPRequest and parse the results.
If you need to screen-scrape the data off the page itself, then I would highly suggest creating your own web service to do the parsing and have your iPhone app talk to your web service. The reason being that if they update the page in a way that breaks your screen scraping you would only have to update your web service instead of deploying an update out to who-knows-how-many iPhones.
Just use an NSHTTPRequest and all the related classes to assemble a standard HTTP GET request for the site with the data you need. If there's a data feed (XML, JSON, etc.), you should find out what that URL is and use it instead of parsing the actual HTML of the web page. If not, the method is called "screen scraping" and it basically involves you writing a regular expression to parse the HTML of the web page returned from the server. Again, don't do this unless there is no alternative data feed you can use.
If you need to parse XML, see NSXMLParser. There are open-source solutions for parsing JSON in Objective-C. Just Google around for them.