Hi Guys
I was trying to develop a cn1lib inspired on TelephonyManager API from Android, at least for Android and iOS.
For Android everything worked just fine, but for iOS I'm facing building problems.
My knowledge on Objective C and Apple build stuff was basically nothing, so I created a xcode project using the generated *Impl.h and *Impl.m from "Generate Native Access" on NetBeans as recommended on video tutorial, and created a native interface only to test the "native component".
To let things more clear, I've added an extra header file basically with a lot of #define directives (loosely based on the results of j2obc conversion tool, running on a Constants.java already existent on my cn1lib - the result file is attached).
On xcode project, I've got everything working fine (on a simulator), but trying to build remotely, seems like that my extra header file is indigest.
Seems like the remote building is trying to compile a com_codename1_telephony_Constants.m that does not exists:
CompileC build/TestApp.build/Release-iphoneos/TestApp.build/Objects-normal/armv7/com_codename1_telephony_Constants.o ../build/xcode/src/app/com_codename1_telephony_Constants.m normal armv7 objective-c com.apple.compilers.llvmgcc42
And after this command, there is a lot of compile errors:
build/xcode/src/app/com_codename1_telephony_Constants.m:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__TIB_com_codename1_telephony_Constants'
...
/var/folders/p_/xlvwhg4101z8r81_nl13cds80000gn/T/build3644309836102685804xxx/dist/../build/xcode/src/app/com_codename1_telephony_Constants.m:843: error: '__TIB_com_codename1_telephony_Constants' undeclared (first use in this function)
It's posible to do something like this, I mean, aggregate extras (not *Impl.*) native files in a cn1lib for iOS? If it's posible, for each .h file is necessary a .m? It's posible to use precompile directives?
I can change my approach trying to define my constants with "extern const int MY_INT_CONST;", but I'do like to know if there is something that can be done to maintain the j2obj based conversion script (avoiding rewrite stuff now and automatize future Constants.java changes).
PS: I'do like to publish this project on github and make it open. I don't know if there is some guideline for this, I mean, now I'm using com.codename1.telephony namespace, so I don't know if is better to use com.codename1x or even not use codename1 at all. At the moment, it basically has one class (TelephonyInfo) that gets MNC, MCC, country code and carrier name from Androids (Network and SIM data) and iOS (from SIM only, due Apple restrictions). The cn1lib is basically a TelephonyManager (from Android) and CTTelephonyNetworkInfo (iOS) mesh up.
Thanks and Best Regards