Does iPhone/iOS development allow the use of third-party compiled libraries? - iphone

We're currently negotiating an outsourced iPhone development - and one of our requirements is that we also get the project source at the end of the development to allow us to enhance/update once the initial app is released.
The developer does not want to release the source of their own common libraries - which is understandable - and have said that they will have to write new code to replace those libraries.
However - on other platforms, it is possible to include libraries as pre-compiled software so that the source code is not necessarily released. Is this possible with iPhone app development? And if so, is it easy to implement?

Yes it is perfectly possible look at the admob or flurry libraries for example
To make a static library look here http://blog.stormyprods.com/2008/11/using-static-libraries-with-iphone-sdk.html

Related

Compiling an iPhone XCode project to work on Android

I have an iPhone app which is written in XCode and is currently selling on the iTunes app store. I want to be able to release it for the Android market. Is there any way to compile my app from XCode to work on the Android operating system. I don't really want to learn a new language and completely rewrite my app, so was wondering if there is an easier way.
There isn't any way to compile Android apps from Xcode, and i strongly doubt that Apple would introduce such a feature - if it's even technically possible to do. Sorry.
But if you have Objective C down, you shouldn't have to much problems understanding Java (which is used for creating Android apps).
Check the link below for a pretty comprehensive guide to start learning java and code for the Android platform:
http://mobile.tutsplus.com/tutorials/android/java-tutorial/
Good luck!
No, in general you can't do this. Even if assuming Objective-C can be compiled/converted into Java (which is most likely will not be true for times to come), you'll need to rewrite UI part; then most of OS APIs are different too. There are several features that iOS has that Android lacks or does not have open API for it, or has limited API, or has conceptually different or just different API.
Its just easier to move some of your iOS code into C/C++ shared library and then make sure that it compiles and works on both platforms. And then make platform dependent pieces separately for each platform (UI, hardware related stuff, etc.). This way you'll have at least part of your code shared.

Is there a way to develop a cross-platform app for iPhone/iPad/Android? [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Technology to write iPhone, BlackBerry and Android phone at the same time?
Edit - guys, we need one more vote to close this. This question is a dup (read the comments)
I've heard that Apple banned such tools. Ok, so Apple lifted their ban in September. Still, the question holds - is there a sane way to develop apps to these two platforms without writing nearly everything twice?
Is there something I'm missing, or is the current state of affairs really that every company that develops a cross-platform legally has to maintain two code bases?
Apple reversed their ban in early September after receiving some pressure from the FTC and EU. However, unless you plan on using a third-party tool such as Adobe Flash Pro CS5 (I believe you can create AIR apps that will run on Android this way, as well as the much publicized iOS functionality), you'll have to maintain two codebases anyway, as Android apps are written in Java and iOS apps in Objective-C, two vastly differently languages with vastly different APIs.
You can always use standard HTML5 technologies to make a pure web app. Apple has two tracks for apps: native apps through the App Store written in Objective-C, or web apps that have only the restrictions of the underlying HTML5 technologies.
If you don't like pure web apps you can even merge the two and make a custom app that displays heavily customized web-like content in an embedded browser view (UIWebKit on iOS). Android and iOS web browsers frameworks are from WebKit and very close in features/appearance/conformance.
Instead of starting from a viewpoint of "I can't do X on Apple's closed iOS" start with "Can I do this in any supported application technology, even if its web-based or a web app hybrid, available across all platforms?"
I've done some research on this recently and have found a few companies that can to do this for you.
Appcelerator Titanium Mobile. They make a product that allows you to write your code in Javascript. I've found that the business logic, like networking, files, etc are write once, but the UI has quite a bit of if(android) else \iphone logic to get right. Apps will look native.
FeedHenry. They are more of a HTML based solution, but have a broader support of devices. More than just iphone and android. The sdk is still pretty early, and work can only be done in their special ide that is web based.
Phonegap. A javascript/css/html based framework that targets the iPhone, Android, and the Blackberry.
There are plusses and minuses to all of the solutions. Depending on your app's complexity, it may be a good decision to pick a platform like those to develop on. Coding an app could be much faster if the features they support are right for your app. Right now, it seems that they are all in early release phases and don't support a full toolkit that a developer would be used to, like a debugger, full IDE support, etc. Also, many of them build to a lowest common feature set, so you may not get all of the new release features as they come out, you would have to wait for a particular version of the platform to be released in order to have them.
XMLVM: Android to iPhone
XMLVM can translate your Android code to Objective-C for iPhone. But as what I know you still need a Mac to compile the iPhone application.
Android has the NDK (native dev kit) to allow C and C++ code to be included in APKGs and called from Java via the JNI. Apple's toolchain will also deal with both; the code that will be different will be the platform interface code, mostly in Java on Android and ObjC on iOS.
This is only useful when the bulk of your application is in C or C++.
An alternate would be to go with MonoTouch and the upcoming MonoDroid, if everything works out you could basically code C# on all platforms including of course Win7 Mob.
It looks promising but haven't tried it myself yet.
In September, Apple lifted some of the restrictions in the iOS license that had made it difficult to do cross-platform development. See this press release. I'm not familiar with the details of the current license, but you can get a copy through their developer program.
Another possibility that would be the Rhodes framework, if you like MVC, ORM, and Ruby.
take a look at the System.getProperty() values with android the vendor shows as The Android Project. I haven't looked at the iPhone or the IPad since I don't have one but hopefully they have something changed for their's too. But this will only work with java that I know of.

support iphone,ipad,android

develop android apps that should support iphone,ipad,android.is there any way for developing this kind of generic app or we need to develop aps depending on mobile os
Though it is possible to create an universal application for iphone and ipad i don't think you can do the same for Android.
In my opinion it is always better to port your application to Android based on your requirements so that you can take advantages of the API's that the platform is offering you.
You can try using a framework named Titanium Appcelrator. This framework will help you target iPhone, iPad, Android with the same code base. This also lets you access most of the Native hardware features available with these platforms but not all. It seems that this also may support Blackberry soon.
We are struggling with the same question at the moment. Since we are working for Android, Maemo, Meego, iPhone and Blackberry (+Symbian 3 soon), HTML5 looked promising, and we dedicated quite some time investigating it. The end result was HTML5 is not yet ready for the development we were hoping for. It's fine if you need simple functionality, but as soon as something more advanced is needed, you need to create a different version. Even if it suits your needs, every platform requires different HTML5-to-native bridge, and every platform has a different engine. As you can see, only front end part could be partially used.
In your case, you need two different applications, one for Android, another one for iPhone/iPad. Try to see if you could take advantage of HTML5, if not, you are unfortunately stuck with separate development for some time to come. Unless you will create a web app and use it with device's browser.
You can create common functionality libraries with C or C++ and use these libraries in iPhone/iPad and use Android's NDK tool to integrate theses libraries with Android
On Android, you're using Java as the main language, and you can also use C and C++ . On iOS, you're using Objective-C as the main language, and also can use C and C++. So the common denominator would be C (at least on the iPhone there are no C++ GUI classes). I have no idea about developing on Android, but on iPhone it's no fun to purely work in C (and I'm not sure if it's even possible, maybe it is but should I when working with Objective-C/Cocoa is fun).
What you can do is write generic logic and share that between both systems, like a library. For example, I worked on a project where we used a C++ SIP/VoIP library that also compiles and runs on Symbian. It shouldn't be a big problem to write C code that can be shared between iOS and Android, as long as it is mostly about logic and not about calling system-specific stuff (you can of course include system specific stuff and guard that with #ifdef but you don't want your library to have more system-specific than system-agnostic code, I guess). For example, if you intend to write a networked game you could implement the network protocol in a way that could be shared between iOS and Android.
But as soon as you're hitting the GUI level I don't think you can share any code, and even if you could you probably don't want to because if you use the native languages/IDEs you are faster designing the GUIs each in their respective main languages/IDEs than trying to find a common way and then have to live with compromises and trying to make it work on both systems all day long. Better to implement the GUI native to each platform (e.g. Xcode has a very good graphical tool called Interface Builder that can save a lot of work/typing).
we can go for the XML VM to run the android apps in iphone.
Check this for more info.
xmlvm.org

How to develop distributable UI controls for iPhone?

I would like to develop a reusable UI control for iPhone. How should I go about doing this? When I say reusable I mean it's packaged in a dll (or whatever is used on iPhone platform) so it can be reused on multiple projects.
While dynamic libraries are not allowed to be used in iPhone applications that are to be sold on the iPhone App Store, here's a tutorial on building static libraries with the iPhone SDK. (assuming you don't want to release source code)
You have two options:
Supply the full source code. Other developers can then add it directly to their app.
Distribute the compiled version of your code as a static library.
As you're planning to develop a UI control, I suggest you also develop an IB plugin and ship that with it too.
You probably want to provide custom Interface Builder objects, or maybe source code libraries.
Well, the Xcode way would be to bundle your code into a Framework and link to that. However, under the iPhone you can't link to non Apple approved frameworks (even if they are your own)
So you would probably have to link in the source to the reusable code. A good article here

Can I write native iPhone apps using Python? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Using PyObjC, you can use Python to write Cocoa applications for OS X. Can I write native iPhone apps using Python and if so, how?
You can use PyObjC on the iPhone as well, due to the excellent work by Jay Freeman (saurik). See iPhone Applications in Python.
Note that this requires a jailbroken iPhone at the moment.
Not currently, currently the only languages available to access the iPhone SDK are C/C++, Objective C and Swift.
There is no technical reason why this could not change in the future but I wouldn't hold your breath for this happening in the short term.
That said, Objective-C and Swift really are not too scary...
2016 edit
Javascript with NativeScript framework is available to use now.
It seems this is now something developers are allowed to do: the iOS Developer Agreement was changed yesterday and appears to have been ammended in a such a way as to make embedding a Python interpretter in your application legal:
SECTION 3.3.2 — INTERPRETERS
Old:
3.3.2 An Application may not itself install or launch other executable
code by any means, including without
limitation through the use of a
plug-in architecture, calling other
frameworks, other APIs or otherwise.
Unless otherwise approved by Apple in
writing, no interpreted code may be
downloaded or used in an Application
except for code that is interpreted
and run by Apple’s Documented APIs and
built-in interpreter(s).
Notwithstanding the foregoing, with
Apple’s prior written consent, an
Application may use embedded
interpreted code in a limited way if
such use is solely for providing minor
features or functionality that are
consistent with the intended and
advertised purpose of the Application.
New:
3.3.2 An Application may not download or install executable code.
Interpreted code may only be used in
an Application if all scripts, code
and interpreters are packaged in the
Application and not downloaded. The
only exception to the foregoing is
scripts and code downloaded and run by
Apple’s built-in WebKit framework.
Yes you can. You write your code in tinypy (which is restricted Python), then use tinypy to convert it to C++, and finally compile this with XCode into a native iPhone app. Phil Hassey has published a game called Elephants! using this approach. Here are more details,
http://www.philhassey.com/blog/2009/12/23/elephants-is-free-on-the-app-store/
Yes, nowadays you can develop apps for iOS in Python.
There are two frameworks that you may want to checkout: Kivy and PyMob.
Please consider the answers to this question too, as they are more up-to-date than this one.
An update to the iOS Developer Agreement means that you can use whatever you like, as long as you meet the developer guidelines. Section 3.3.1, which restricted what developers could use for iOS development, has been entirely removed.
Source: http://daringfireball.net/2010/09/app_store_guidelines
Pythonista has an Export to Xcode feature that allows you to export your Python scripts as Xcode projects that build standalone iOS apps.
https://github.com/ColdGrub1384/Pyto is also worth looking into.
The iPhone SDK agreement is also rather vague about whether you're even allowed to run scripting languages (outside of a WebView's Javascript). My reading is that it is OK - as long as none of the scripts you execute are downloaded from the network (so pre-installed and user-edited scripts seem to be OK).
IANAL etc etc.
BeeWare is an open source framework for authoring native iOS & Android apps.
2019 Update:
While Python-iOS development is relatively immature and likely will prevent (afaik) your app from having native UI and functionality that could be achieved in an Apple-supported development language, Apple now seems to allow embedding Python interpreters in Native Swift/Obj-C apps.
This supports importing Python libraries and running Python scripts (even with supplied command-line arguments) directly from your Native Swift/Obj-C code.
My company is actually wrapping our infrastructure (originally written in Python) in a native iOS application! It works very well and communication between the parts can be easily achieved via a client-server model.
Here is a nice library by Beeware with a cookiecutter template if you want to try and run Python scripts in your iOS app: https://github.com/beeware/Python-Apple-support/tree/3.6.
Technically, as long as the interpreted code ISN'T downloaded (excluding JavaScript), the app may be approved. Rhomobiles "Rhodes" framework does just that, bundling mobile Ruby, a lightweight version of Rails, and your app for distribution via the app-store. Because both the interpreter and the interpreted code are packaged into the final application - Apple doesn't find it objectionable.
http://rhomobile.com/products/rhodes/
Even after the latest apple press release - rhodes apps (mobile ruby) are still viable on the app-store. I'd find it hard to believe that tinyPy or pyObjC wouldn't find a place if there is a willing developer community.
You can do this with PyObjC, with a jailbroken phone of course. But if you want to get it into the App Store, they will not allow it because it "interprets code." However, you may be able to use Shed Skin, although I'm not aware of anyone doing this. I can't think of any good reason to do this though, as you lose dynamic typing, and might as well use ObjC.
The only significant "external" language for iPhone development that I'm aware of with semi-significant support in terms of frameworks and compatibility is MonoTouch, a C#/.NET environment for developing on the iPhone.
I think it was not possible earlier but I recently heard about PyMob, which seems interesting because the apps are written in Python and the final outputs are native source codes in various platforms (Obj-C for iOS, Java for Android etc). This is certainly quite unique. This webpage explains it in more detail.
I haven't given it a shot yet, but will take a look soon.