PDA

View Full Version : Third Party Libraries on iPhone?




russell.h
Apr 1, 2008, 09:16 PM
Is it possible to use third party libraries (libpurple comes to mind) on the iPhone? If so, can someone explain how, or link me to some information on it?

Thanks,

Russell



ChrisA
Apr 1, 2008, 09:44 PM
Is it possible to use third party libraries (libpurple comes to mind) on the iPhone? If so, can someone explain how, or link me to some information on it?

Thanks,

Russell

I'd assume it would have to be statically linked

Sayer
Apr 2, 2008, 12:34 AM
iPhone is not a desktop or laptop computer. It is a PDA/Phone with severe memory restrictions, tight battery usage and only a subset of full OS X features. An app can't remain running in the background and constantly poll the network on an iPhone, it just isn't intended to be used that way.

I suggest learning to program on Mac OS X, sign up and get the iPhone SDK, learn the differences, and then figure out what to do as far as iPhone software.

russell.h
Apr 2, 2008, 01:44 AM
I know what I'm trying to do and how I'm trying to do it, and it will work fine on an iPhone in terms of the hardware limitations. Using libraries (dynamically linked) can actually reduce memory usage if you have more than one program that needs access to the same functionality, as the library only needs to be loaded into memory once. And one way or another, re-implementing chat protocols is a complete waste of my time.

I'm just wondering:

1. Is it possible to use dynamically linked libraries? (I think not)

2. Is it possible to use statically linked libraries, in light of the different architecture, etc?

3. If any of the above is possible, how?

gnasher729
Apr 2, 2008, 02:49 AM
I know what I'm trying to do and how I'm trying to do it, and it will work fine on an iPhone in terms of the hardware limitations. Using libraries (dynamically linked) can actually reduce memory usage if you have more than one program that needs access to the same functionality, as the library only needs to be loaded into memory once.

Since only one application is running at a time, there will be only one copy of a library in memory anyway. No savings there.

fishkorp
Apr 2, 2008, 09:01 AM
I think part of Apple's "rules" for app development state you can't use 3rd party libraries. Better read them over again.

iSee
Apr 2, 2008, 09:38 AM
I know what I'm trying to do and how I'm trying to do it, and it will work fine on an iPhone in terms of the hardware limitations. Using libraries (dynamically linked) can actually reduce memory usage if you have more than one program that needs access to the same functionality, as the library only needs to be loaded into memory once. And one way or another, re-implementing chat protocols is a complete waste of my time.

I'm just wondering:

1. Is it possible to use dynamically linked libraries? (I think not)

2. Is it possible to use statically linked libraries, in light of the different architecture, etc?

3. If any of the above is possible, how?

I didn't read the docs exhaustively, but the parts I read said you are only allowed to install files to your app's folder. So you could use a dynamic library, but not a shared one--you'd have the library installed with your app's bundle.

But any library you use (dynamic or static) is going to have to be ported to the iPhone--either by you or by someone else.

libpurple is an IM libaray, right? You can do an IM app for the iPhone, but, because you aren't allowed to run background tasks (as far as I know), you're only going to be able to receive IMs while the app is running.


I think part of Apple's "rules" for app development state you can't use 3rd party libraries. Better read them over again.

Are you sure about that? That doesn't sound right. I know you aren't allowed to host third-party plugins for some reason, but I didn't see anything about third-party libraries.

iPhone is not a desktop or laptop computer. It is a PDA/Phone with severe memory restrictions, tight battery usage and only a subset of full OS X features. An app can't remain running in the background and constantly poll the network on an iPhone, it just isn't intended to be used that way.

I suggest learning to program on Mac OS X, sign up and get the iPhone SDK, learn the differences, and then figure out what to do as far as iPhone software.

??? I'm not sure how this relates to the question.

Eraserhead
Apr 2, 2008, 10:31 AM
I can't believe you won't be able to use third party libraries on the iPhone. Send ADC an email and ask if you are unsure.

ChrisA
Apr 2, 2008, 10:42 AM
Using libraries (dynamically linked) can actually reduce memory usage if you have more than one program that needs access to the same functionality, as the library only needs to be loaded into memory once.

Re-read the part about no background processes. There will never be more then one program running at a time. The advantage of dymanic linking goes away. As I said statically linked.

Dunamically linked libraries would not work well with Apple's distribution model either.

Monkaaay
Apr 2, 2008, 10:53 AM
Did anyone email ADC about this yet? I'm guessing a statically linked library will work but I haven't seen anyone talk about it yet. Let us know if you're able to get it working.

3247
Apr 2, 2008, 11:05 AM
Is it possible to use third party libraries (libpurple comes to mind) on the iPhone? If so, can someone explain how, or link me to some information on it?Libpurple (and other GPLv2'd libraries) are not compatible with the conditions Apple sets for it's SDK and distribution through iTunes Store. :mad: You can't use them.

gnasher729
Apr 2, 2008, 11:36 AM
Libpurple (and other GPLv2'd libraries) are not compatible with the conditions Apple sets for it's SDK and distribution through iTunes Store. :mad: You can't use them.

You'd have to explain why that would be the case. All applications are shipped as packages, you can just put the source code into the package, and you are fine.

russell.h
Apr 2, 2008, 11:49 AM
You'd have to explain why that would be the case. All applications are shipped as packages, you can just put the source code into the package, and you are fine.

I hadn't thought about that, but now that I do, it could definitely be a problem. As the distributor of the binary, I believe that Apple would be required to offer the source code as well. And I'm not sure that encapsulating the source in the package destined for the iPhone would be considered a sufficiently standard or transparent means of doing so. But I'm more interested in the technical aspects of this.

iSee
Apr 2, 2008, 03:06 PM
Ah, couldn't you simply provide a link to the source? This is the common method of satisfying the license requirements, right?

Eraserhead
Apr 2, 2008, 03:33 PM
^^ Exactly otherwise they wouldn't be able to distribute any open-source software at all, which would be crazy.

gnasher729
Apr 2, 2008, 04:10 PM
I hadn't thought about that, but now that I do, it could definitely be a problem. As the distributor of the binary, I believe that Apple would be required to offer the source code as well. And I'm not sure that encapsulating the source in the package destined for the iPhone would be considered a sufficiently standard or transparent means of doing so. But I'm more interested in the technical aspects of this.

What does GPL conformance have to do with Apple? They will just offer a service that allows an end user to download software created by a developer. I don't think you are giving any good argument for your scare mongering against GPL software.

Supplying source code inside the application package is exactly one of the methods suggested by the GPL to supply source code: Deliver it together with the executable code. And very easy to handle, because as the supplier, you don't need any infrastructure, and you have no future obligations at all.

3247
Apr 2, 2008, 05:02 PM
You'd have to explain why that would be the case. All applications are shipped as packages, you can just put the source code into the package, and you are fine.Well, you can't modify it and install it on your iPhone.

Granted, that's only a violation of the terms of GPL v3, not v2. So it might be ok with GPL v2 programs in the US and other Common Law countries. However, in other legislations, there are methods of construction that allow to close such gaps.