I am making an iOS app that will display images, videos, and textual information that I provide.
this information needs to be updated and refreshed as the user requests, time interval, and when the user opens the app. Not hardcoded and changed on app store updates.
How would i go about doing this?
Do I need to create an online web server that I pull the information from?
If so how would I go about creating a server?
Could anyone point me in the correct direction?
yeah you have to use web Services. that means you have to create one server & from that server you can send images,text as you required without making hardcoded. you just have to pull the value from web service.
images,text all this can be send through xml & you have to accept that xml & have to parse it
You can install an Apache server on your MacOS, read read this:
http://osxdaily.com/2012/09/02/start-apache-web-server-mac-os-x/
I ended up using parse which has excellent mobile support. And is free until you receive a certain amount of traction. I recommend it!
Related
I am wondering about what the best way to keep users in sync with each other in a social network is. The concerned stack is an iOS app with a NodeJS backend. Let me give you an example:
Say X and Y are friends on a social network. Y's posts appear in X's feed, and as such, Y is cached somewhere on the X's phone. This morning, Y decided to change profile pictures however. Everything is well, the new picture is uploaded to the server, but how do we go about letting X know about the change of profile picture?
My possible solution: Create a route /<UID>/updates that contains a stack of "cookies" which lets the user know what and who changed since the last time they made a GET request to the route.
This seems elegant enough, but what worries me is what happens on the client side (am I supposed to make a GET request every 2 minutes during my app's uptime?). Are there any other solutions?
One solution is indeed to poll the server, but that's not very elegant. A better way is to make use of websockets:
WebSockets is an advanced technology that makes it possible to open an interactive communication session between the user's browser and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply.
They are a 2-way connection between client and server, allowing the server to notify the client of any changes. This is the underlying technology used in the Meteor framework for example.
Take a look at this blogpost for an example of how to use websockets between an iOS client and a NodeJS backend. They make use of the open source SocketRocket iOS library.
We've developed a web application which is hosted on premises available for people in the shop floor via Wifi. However, the wifi signal is not reliable and it's not possible to use wired network or improve the signal.
I am looking for a solution to handle this issue. Is there a way to put the http requests into a local queue and process it asynchronously at the background? If so, how to do it? Or is there any other alternative approach?
Any thoughts are greatly appreciated.
I have the same problem in the company where I work, there are certain places where the WiFi can not reach, and the system needs to get information from the DB in order to show that info to the user and then upload some new info.
Part of this system is done with iPads, so to solve the problem I use LocalStorage to store a JSON object that contains the info the user need to work, I store the info that is going to be uploaded in another JSON object, and when there is a connection available the info is Uploaded.
Hope it helps
I would recommend to build the web app with angularjs or another javascript framework of your choice. Once the user has loaded the site you can perform asynchronous ajax/http requests to load the required data and the web app will never reload the entire page.
In case one http request fails you can implement that the web app should try one more time or whatever :)
My app relies on an external service that might change its output any time without warning, so I would need a completly new function to parse it. Is there anyway to update my service parser without having to re-submit the whole app for review? Otherwise part of my app would be broken during the time to develop and review the new parser. I was told I cannot use bundles for this, so I really am clueless how to solve this problem.
You can't solve that problem completely on the client side.
Depending on the output format of the external service, and the methods you use to parse its output, you might have the option to store a file in a server that contains information about the current output format of the external service. Then your app can use the meta-data in that file to determine how to do the parsing.
You can also develop a simple web service that wraps the external service. Then your app can use the web service instead of the original service, and whenever the output of the original service is changed, you can quickly update your web service to make your app continue functioning properly.
I'm currently developing a server that can get data over the internet from specific device i have and log it into a database. Unfortunately I dont have control on the way this device communicate.
Currently I set an IP adress and a port number and the device will open a socket and send a string. I dont really want to develop a server from scratch and i would much prefer to base on a web server. but the data is a plain string and not a full http request.
Is there a way around it using Ruby on rails ? Is it possible to do with other web-server-based technology ?
Thanks a lot
You can use just a regular old ruby socket to receive the string.
Sounds like an application that node.js would be useful for, if you want a pre-made node+rails app which would do what you want check out compound at GitHub mentioned in this article
I'm just starting to learn about iOS development, and I figure the best way to get started is to build a simple (but non-trivial) app. My idea is this: have a web interface where a user can create a survey, and then access those surveys through the app and send responses back to the server. The web design part probably won't be terribly difficult -- I've done similar things with Django before. The part that will require learning/effort is the iPhone app.
I've got enough Objective-C that the data structures (model) won't be hard to code, and the UI (view, controller) part shouldn't be bad either. I predict that the interface between web and phone will be difficult, though. In particular, how will I be able to access the database on the server from the phone? I'd like to have a single DB that both web and phone apps use.
What I'd really like to have is a general, broad-strokes description of what I'll need to do to get this all up and running. Am I right in believing that the networking will be the hardest part? Are there any other possible snags? Any advice, or pointers to good resources on the subject, would be greatly appreciated.
Networking will probably not be the hardest part here, you're just guessing because that aspect is unfamiliar to you. For example, you can use NSURLConnection to take care of pretty much all the details of server connection. You can use NSJSONSerialization to convert your data to and from a format that is suitable for sending over the wire.
Basically what you might do is:
Mobile app sends a HTTP GET request to the server for survey info.
Server responds with a JSON description of the survey.
User fills out survey.
When done, the app sends the responses back in JSON format as a HTTP POST to the server.
Server stores the results in the database.
One of the key points here is that the app on the phone does not try to access the database directly. All requests go through your Django web app.