Questions tagged [j2objc]

J2ObjC is an open-source command-line tool from Google that translates Java code to Objective-C for the iOS (iPhone/iPad) platform.

J2ObjC is an open-source command-line tool from Google that translates Java code to Objective-C for the iOS (iPhone/iPad) platform.

137 questions
18
votes
2 answers

Handling Navigation from a Non-Ui part of an App?

Note: When I talk about App Backend I do not mean Server backend. The App backend is part of the app. It is the non-ui part of the app. I have a code design question. Using j2objc Java is used as backend of an iOS app, where the frontend is still…
user4788711
13
votes
0 answers

warning: URGENT: building for watchOS simulator but linking object file built for iOS

While integrating my java library converted by j2objc I'm receiving this message. ld: warning: URGENT: building for watchOS simulator, but linking in object file (/Users/admin/Documents/j2objc/dist/lib/libjre_emul.a(IOSArray.o)) built for…
Vyacheslav
  • 26,359
  • 19
  • 112
  • 194
13
votes
3 answers

How to handle UI based Navigation in Cross Platform Apps?

Assume that you have a cross platform application. The application runs on Android and on iOS. Your shared language across both platforms is Java. Typically you would write your business logic in Java and all you UI specific part in Java (for…
user4788711
8
votes
2 answers

Difficulties implementing Model-View-Presenter in Android

Model-View-Presenter (MVP) is a well known design pattern for GUI applications. For Android, implementing the business logic in a plain Java module facilitates testing without requiring an Android emulator. However, I am having difficulties…
foens
  • 8,642
  • 2
  • 36
  • 48
6
votes
1 answer

Serializing a Swift class to JSON using J2ObjC and GSON library

I'm very new to iOS, moving from Android development. We have an Android application which has several libraries which we're using J2ObjC to translate into Objective C. I've been gradually bringing over the libraries and so far, so good. However,…
Ricky
  • 7,785
  • 2
  • 34
  • 46
5
votes
3 answers

Access Enum translated with J2objc in Swift

I use J2objc to translate Java to Objective-C. This code I use with a bridging header to make it available in Swift. Here is a Java Enum I translated: public enum BTestType { Type1, Type2, Type3; } In Objective-C I get the following header…
Michael
  • 32,527
  • 49
  • 210
  • 370
4
votes
1 answer

Xcode cannot find header files when files added in folder reference mode

I am trying to add many Objective-C files to my Swift project with folder reference mode that means when I drag and drop my files into project I am selecting "Create Folder Reference". This is because all of my obj-c files use #include…
Sajjad Hajavi
  • 501
  • 7
  • 9
4
votes
3 answers

Convert JavaUtilList to NSArray?

Using J2objc I have a JavaUtilList: var javaArrayList:JavaUtilList = JavaArrayList() I want to convert this list into an NSArray: var arr:[String] = // ???? How can I convert a JavaUtilList into an Objective-C/Swift NSArray?
Michael
  • 32,527
  • 49
  • 210
  • 370
3
votes
0 answers

symbol(s) not found for architecture x86_64 in swift project

I convert java to objective-c,and import it into a swift project by bridging-header file. When i build the swift project, get the following error: Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_DTPeople", referenced from: type metadata…
Leo
  • 835
  • 1
  • 12
  • 31
3
votes
1 answer

How to compile java code with swift in XCode

I use J2Objc by Xcode build rules in Xcode(swift). Write a java file(People.java) 2.make settings for build rules, and add the custom script as the following: "${J2OBJC_HOME}/j2objc" -d ${DERIVED_FILES_DIR} -sourcepath …
Leo
  • 835
  • 1
  • 12
  • 31
3
votes
2 answers

How to translate an entire folder or package from Java to Objective-C?

I've used an older version of Google's Java to Objective-C (J2ObjC) converter previously (i.e. version 0.5.2) and it was straightforward to translate an entire folder of Java files to their equivalent Objective-C files (and to preserve the directory…
Adil Hussain
  • 30,049
  • 21
  • 112
  • 147
3
votes
1 answer

Determine current platform in j2objc

What is the best way to determine the current platform (Android vs. iOS) when working with j2objc? Or a more general question: How to use different code for Android and iOS, for example when handling database access or networking?
gingo
  • 3,149
  • 1
  • 23
  • 32
3
votes
1 answer

How to use j2objC for conversion in iOS code?

I want to use my android code for i OS. I have seen many links recommends using of j2objC translator. But i don't know how to use this translator. can any body tell the all steps involved in this conversion?? I need the step-wise method
3
votes
2 answers

Expressions in a build rule "Output Files"?

Can you include expressions in the "Output Files" section of a build rule in Xcode? Eg: $(DERIVED_FILE_DIR)$(echo "/dynamic/dir")/$(INPUT_FILE_BASE).m Specifically, when translating Java files with j2objc, the resulting files are saved in…
Calin
  • 2,110
  • 1
  • 21
  • 36
3
votes
4 answers

Can Google's j2objc process and convert binary JAR files?

I'm looking to get started with mobile development (specifically iOS), and while I'm usually pretty good at learning languages, Objective-C confounds me at almost every turn. So, looking at j2objc (because I already know Java), I think it might fit…
jzeitler
  • 71
  • 2
1
2 3
9 10