Iphone apps communication - iphone

I want to create two iPhone apps: server+client (for once iphone).
Server will contain some data and client will asking for it sometime.
How I can to organize communication between them?
For example anybody knows how TextExpander works?
Regards,
Andrey Mirzoyan.

As a suggestion, a good starting point would probably be the Bonjour Overview docs as it would provide a means of broadcasting/listening to see what clients are currently available.
There's also some sample code associated with the NSNetService class reference docs that might prove very useful and at least provide some good pointers as to where to look next.

If this is for use on one phone, then the only inter-application communication method that will work within a single stock OS iOS device is to have each app register a custom URL scheme, and have each app (re)launch the other app using these custom URL launches for communication, back-and-forth.
The URL scheme will contain a prefix. The suffix of the URL can contain the data of the request or reply, if appropriately encoded.

Related

Interprocess communication between iPhone apps

I need to implement a communication between a central app that runs always and other apps that may request services from that app. There should also be a way to communicate back to those requests even if they have been closed (i.e. loading them to get the responds). What is the best way to implement that on iPhone? (on Android a solution could be done using StartActivity)
Thanks
On the same device? Impossible with official APIs.
If jailbreaking is an option, try the CPDistributedMessagingCenter class. It has a very good documentation on the iPhone Dev Wiki (just google it). You may also want to look at how I used it one of my tweaks: see the daemon's implementation on GitHub.

WiFi possibilities on iOS

Is it possible on iPhone to create a data connection by specifying the SSID of the network?
Is it possible from application to check the signal/availability of the network with specified SSID?
Regards,
STeN
What you're trying to do is sadly not possible without the usage of private (undocumented) API-s.
Hopefully Apple will provide this kind of functionality (with users permition) though i don't think this is bound to happen soon.
If you want to research this topic further the first place to check would be iphone-wireless - the home of Stumbler which shows a nice usage of MobileApple80211.

share data between two separated applications in iPhone

I'm developing two separated applications but there is a plist file for one of those app contains data that I need it on the other one.
is there is any way to get data? in case yes please show me some sample code? what about the NSUserDefault could it be useful?
NSUserDefault will not work. You need to create a custom URL scheme for your app and then you will be able to pass some data to your another app.
follow these url's you will find what you want.
http://www.tutoplanet.com/android-tutorials/ios-sdk-working-with-url-schemes/
http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
NSUserDefaults will not help you at all. Your applications are each sandboxed separately and have access to very little other than their own data.
You can, however, open a file from one app in another. You can see more about that here.
Other Resources
Apple Approved iPhone Inter-process Communication
2-way app integration on the iPhone: How it works

Logging into and communicating with a server from an iOS app...help!

Hey everyone. I have a fair amount of experience developing iOS apps, but nothing much with web/server interacting apps. For a project at work, I am making an app that will let you login, and get pictures off from a server that will then be downloaded for display and review on the local device.
I need to get some pointers on the correct approach to take. Are there built-in classes that make doing something like this easy? Once the cogent is downloaded from the server, it will be viewed locally, so all I need is to get a point in the right direction for logging in and communicating with a server…from an iPhone.
Can anybody point me in the right direction?
Me, I'm using ASIHTTPRequest Librayry to communicate / download with Internet.
For example, for an news app I download latest news in JSON (with a PHP script on a web server) and store datas with SQLite. If you need a little explanation of JSON with iPhone, check here (in french, but source codes are in english ^^)
When I need to download an image, I use ASIHTTPRequest and a queue to avoid downloading to much files at the same time.
If you want more information about a step, just say it.
Good Luck !
NURLConnection is your friend, along with its delegate methods.
Don't be lured by the temptation to use the -sendSynchronous method (which, now that I think about it, if you require authentication, you probably can't use anyway).

Native app for iPhone!

I want to develop a native universal app(i.e for iPhone and iPad) for my orgaization.I want to include some of the essential features of the organiztion website into my native app.For obvious reasons i cant store this huge data into iPhone itself.so data will be fetched from the server but application would be a native app.so are there any APIs available to do this?
I always find it's easier to start using sample code, and lucky for you Apple provides a lot of this. Here is the reference library for all kinds of goodies to learn off of and hack your way through: http://developer.apple.com/iphone/library/navigation/index.html#section=Resource%20Types&topic=Sample%20Code
A few noted ones... (I left out some advanced ones like BonjourWeb Reachability and AdvancedURLConnections but look at those once you gain a little more understanding)
URL Cache: http://developer.apple.com/iphone/library/samplecode/URLCache/Introduction/Intro.html
RSS Feed Parser: http://developer.apple.com/iphone/library/samplecode/SeismicXML/Introduction/Intro.html
MailComposer: http://developer.apple.com/iphone/library/samplecode/MailComposer/Introduction/Intro.html
Also, a couple books you should get to start your journey on iOS (these are two of the best and easy to understand IMO):
http://apress.com/book/view/9781430224594
http://apress.com/book/view/9781430225058
UIWebView will show any web page you point it to.
Maybe do a mixed approach with some stuff built right into the app, and the bigger or frequently changing parts load from the web.
You can use the UIWebView to access your organization's website from inside a native application...
While I agree that you may need to do your research first, the IPhone/Ipad SDK includes a very easy to use XML parser (NSXMLParser). I would suggest you devise a XML web service for retrieving the data from your company's servers and parse it on the ipad/iphone to the presentation you require.
Best of luck, i've found objective-c very rewarding/challenging.