Providing API for communicating with a running application? - iphone

Basically I'm trying to find a solution to my issue with sharing an object. I've had a look at SpringBoard's implementation and it looks as if SpringBoard is providing a framework which can be used to retrieve SBDisplay objects (which are basically CALayers).
I know this specific issue is related to iPhones, but I also know that this is also used by a lot of Cocoa software. Could someone point out a way to copy such behaviour?
App 1 (Application launcher) :
Launches client applications
Has the main CALayer object
Serves as the window server
App 2 (Client app) :
Needs the main CALayer from App1 to render itself onto
And again, just to reiterate - I am fully aware of AppStore policies. And yes, I am using a jailbroken device.

Related

Can Ionic 3 App handle 500,000 to 1M users?

I am building an App on Ionic 3.
How many users can ionic 3 platform handle?
Is Ionic 3 scalable to 500,000-1,000,000 users?
The App is a basic Progress Tracking Tool and a user is expected to open it 1-2 times per day for max 5 min.
Thanks!
Whether Ionic can handle it isn't the question here, it depends entirely on the foundations on which your app is built.
If your app requires connections to a single or multiple APIs and a full backend system, it will be how well your server can process those loads.
Each instance of an Ionic application will work perfectly fine if built correctly as they're isolated to the device in which it is installed. It's all the important stuff working in the background to serve content to your app which is important.
To provide a primitive example; imagine a social media app like Facebook or Twitter. Let's assume both apps are built to sensible coding standards. If you were to plug either of those apps in to a server that was essentially a dusty old box underneath someone's desk, the entire system would completely crash. There's no way it could handle all of the requests for information because the technology simply can't process it.
The reason they don't crash is because they have large-scale data centres, capable of serving millions if not billions of requests simultaneously - they have good servers.
Moral of the story:
If you're building an app, arguably for any size but certainly for 500K+ people, start with your foundations first. The foundation is the servers/data points which will serve your app. Build that correct, and your Ionic app will work perfectly fine.
Yes it can.
The app it self is self contained, your backend will be the bottleneck here.

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.

User Experience Flow on iOS

Under iOS there are several built in hooks for launching service-specific apps based on a passed URL for example handling http:// (to Safari), handling addresses (to google maps) and phone numbers (to the built in phone app). Several apps make it a standard practice of implementing the rarely used ability (for most apps) to register your own service prefix. Two handy apps that come to mind that implement this are facebook:// and skype:// and it is a handy way to add quasi-integration with their app into yours. Skype even does this on most desktop os's so you can literally run the command line skype://555-1234. You can also check for these registered service prefixes and expose useful menu choices in your apps but I digress.
As with all of these service handlers built in or not, the problem under iOS is that you lose the user and the flow of their experience ends with the phone app (for example). Yes you can embed web views to handle some cases but things like the phone app still win out.
I propose that it would be great that if iOS apps were handed a trailing URL as part of their arguments (even if they accept and might handle say two args already) that by convention when our app is exited we launch the trailing URL we may have been optionally handed. If fully supported in some manner this would allow for multi-app integration and an extended user experience flow-wise. I'm imagining being able for example to launch a phone call and have the user return to my app when it is finished by launching my app again using the URL I passed it such as "myapp://return-context-values". Obviously this could be taken further.
Does such a mechanism already exist in some way? If not I'd like to hear your thoughts on the idea.
Check out x-callback-url.com, it proposes precisely what you're suggesting.
And yes, I think it would be great. You're much more likely to pass a request to me if you know you'll get the focus back, and vice versa.

Technical architecture diagram for an iPhone app

Is there any sample technical architecture diagram for an iPhone app which could depicts high level components and their interactions.
Please guide.
Is there something in particular you are looking for? Have you taken a look at Apple's iOS application programming guides? Or are you looking for their technology overview?
It's nothing like a web application architecture.
Sure, like any software, there's a "front end" and "a back end". But even the simplest web app requires a number of decisions to be made - consider a LAMP app - you've decided a linux box will run apache and serve HTTP responses based on PHP code accessing a MySQL database. And maybe on the client side you're using a Javascript framework!
But any popular web app is more complicated then that, because you need to make sure the app scales and runs all the time when there is a number of possible points of failure. Therefore, an architecture is necessary.
iOS is nothing like that. The user taps a piece of glass and their device draws something to the screen. The complexity of the architecture is based on the demands of the app - can the developer get away with using UIKit or do they need to use CoreAnimation/OpenGL? How complicated is the data in play, should they use Core Data? If it's a media-based app, what video/audio/image frameworks should be used, if any? Etc.
Possibly the only architecture decisions that need to be made are how an app interacts with a server backend... but that's a web app architecture, not an iOS app architecture. Typically an iOS developer that needs to diagram an app architecture can draw an arrow that points to "Cloud" and be done with it.

What is the iPhone SDK Missing?

I've been doing mobile app development for a long time (2001?), but the systems we worked with back then were dedicated mobile development environments (Symbian, J2ME, BREW). iPhone SDK is a curious hybrid of Mac OS X and Apple's take on mobile (Cocoa Touch).
But it is missing some stuff that other mobile systems have, IMO. Specifically:
Application background processing
SMS/MMS application routing (send an SMS to my application in the background)
API for accessing phone functions/call history/call interception
I realize that Apple has perfectly valid reasons for releasing the SDK the way they did. I am curious what people on SO think the SDK is missing and how would they go about fixing/adding it, were they an Engineering Product Manager at Apple.
The biggest shortcoming in my opinion is support for separating licensing from distribution.
What I mean by this is that it should be possible to download a trial version of an application and later purchase a license for that application (from an API call inside the application or from the app store). This would make it much easier to try-before-you-buy and get rid of the current duplicates of many applications with 'lite' versions.
I think lack of push notifications for apps is the big thing we're missing right now. With push, you can register your application to perform a task (like getting the most recent data from a web service) even when it's not running, at a time and frequency the OS decides is best. In an ideal world, along with the existing concept of iPhone apps loading quickly and resuming where you last left off, this solves the problem of not running in the background. I know some tasks will be more difficult or maybe impossible with this strategy, but it's still a pretty good compromise between third party applications and the iPhone's limited hardware.
Originally push was scheduled for last September, but it was removed from the beta SDK and not spoken of since then.
API's I'm personally looking for:
Apple80211 as a public API (private, current API is fine if documented)
Access to Volume buttons (semi-accessible via Celestial, private, needs new API)
Access to Calendar (private, API status unknown)
Access to Bluetooth + SPP profile (status unknown)
Access to Camera (directly, API status unknown)
Access to JavaScript runtime (directly, not through UIWebView, API status unknown)
WebKit access that's lower-level than UIWebView (private, current API is fine)
Access to Music Library (private, current API is fine)
Garbage Collection.
CoreData is missing.
You've mentioned some of the big ones - copy & paste (or in fact any way for apps to collaborate) is another huge omission.
It also seems to lack a desktop synch framework (at least if it exists I can't find it).
Language independence and especially lack of scripting is another pet peeve - objective-c is all very well but more languages to choose from would be good.
Inability to dynamically extend apps, via scripts or otherwise, is another big omission. This is partly an SDK/OS issue, partly licensing.
My list ordered by priority:
Mapping abstraction (the MapKit looks awesome), but that would require a new Google Maps TOS
Music library
Camera (photo + video) Access to more
UIViews, Apple designed some pretty nice custom ones for their apps
Better UIWebKit abstraction
The features I see missing that it should have is
Access to SMS
Direct Access to Google Maps App. You should be able have access to this so you could extend your application to use the built in features provided by Google Maps.
Access to the Bluetooth functionality of the phone.
Access to the Calendar. Why not allow access to simply post a calendar event for the user.
Access to Active Sync. It would great if we could directly access this and communicate back to the Exchange Server.
Core Image. They provide Core Animation but Core Image is missing. I hope that this is added to the API soon.
These are some of the features that my clients have access for in the past and are supprised when they are not available.
We definitely miss a Calendar API and SMS access. So many applications could leverage such APIs. The iPhone allows users to have everything in their pocket, but it's almost useless as long as developers cannot leverage this integration in their apps.
A language with proper namespaces.
A limitation that bugs me is lack of access to system features that require root or setuid. For example: opening privileged IP ports.
I'm not sure there is a good solution to this, as long as Apple's policy is to keep the device locked-down.
Allow program to set some kind of local timed event for your application to bring up an alert and launch your app if the user agrees (like any calendar app). You could do that with push notifications but there are many cases I'd hate to have to rely on a whole server infrastructure and network connectivity just to basically do some timed thing.
Some idea of what direction the user is facing. I cannot believe the GPS chip the newer iPhones use are not capable of reporting direction.
I would personally love to see
Access to the CoreTelephony Framework (Currently private). Which allows access to all the phone functions (Especially sending MMS / SMS).
Some sort of ability to run stuff in the background. While push notifications is ok for most things, but it is a bit hard to leverage CoreLocation (i.e. have the app show a notification at a certain location). Of course this would probably need an on/off button or app specific like push is.
animation view which will be reduce developer to make a cool app , of course the core business local still need consider more , but the view layer could more easy to use ....