Third Party Libraries on iPhone?

Discussion in 'Mac Programming' started by russell.h, Apr 1, 2008.

  1. macrumors regular

    Joined:
    Jul 2, 2007
    Messages:
    112
    #1
    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
     
  2. macrumors G4

    Joined:
    Jan 5, 2006
    Messages:
    11,012
    Location:
    Redondo Beach, California
    #2
    I'd assume it would have to be statically linked
     
  3. macrumors 6502a

    Sayer

    Joined:
    Jan 4, 2002
    Messages:
    981
    Location:
    Austin, TX
    #3
    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.
     
  4. macrumors regular

    Joined:
    Jul 2, 2007
    Messages:
    112
    #4
    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?
     
  5. macrumors G5

    gnasher729

    Joined:
    Nov 25, 2005
    Messages:
    14,249
    #5
    Since only one application is running at a time, there will be only one copy of a library in memory anyway. No savings there.
     
  6. macrumors demi-god

    Joined:
    Apr 10, 2006
    Messages:
    2,076
    #6
    I think part of Apple's "rules" for app development state you can't use 3rd party libraries. Better read them over again.
     
  7. macrumors 68040

    iSee

    Joined:
    Oct 25, 2004
    Messages:
    3,325
    #7
    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.


    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.

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

    Eraserhead

    Joined:
    Nov 3, 2005
    Messages:
    10,275
    Location:
    UK
    #8
    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.
     
  9. macrumors G4

    Joined:
    Jan 5, 2006
    Messages:
    11,012
    Location:
    Redondo Beach, California
    #9
    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.
     
  10. macrumors 6502

    Monkaaay

    Joined:
    Jun 19, 2006
    Messages:
    258
    Location:
    Richmond, VA
    #10
    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.
     
  11. macrumors regular

    Joined:
    Feb 9, 2008
    Messages:
    231
    Location:
    Germany
    #11
    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.
     
  12. macrumors G5

    gnasher729

    Joined:
    Nov 25, 2005
    Messages:
    14,249
    #12
    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.
     
  13. macrumors regular

    Joined:
    Jul 2, 2007
    Messages:
    112
    #13
    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.
     
  14. macrumors 68040

    iSee

    Joined:
    Oct 25, 2004
    Messages:
    3,325
    #14
    Ah, couldn't you simply provide a link to the source? This is the common method of satisfying the license requirements, right?
     
  15. macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Messages:
    10,275
    Location:
    UK
    #15
    ^^ Exactly otherwise they wouldn't be able to distribute any open-source software at all, which would be crazy.
     
  16. macrumors G5

    gnasher729

    Joined:
    Nov 25, 2005
    Messages:
    14,249
    #16
    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.
     
  17. macrumors regular

    Joined:
    Feb 9, 2008
    Messages:
    231
    Location:
    Germany
    #17
    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.
     

Share This Page