Application stopped unexpectedly on Android Platform
Hi folks,
I´m also trying build a application on a Galaxy Tab GT-P1000 running Android 2.3.3 but I have had some problems.
In the first line, we I call "DomainParticipantFactory.get_instance()" my application simply closes. Android says that application has stopped unexpectedly and I´m not able to catch the exception even using a "try catch (Exception)" block.
This same application is working fine in Java.
I didn´find any documentation about building for Android.
Is there any documentation that could help me?
OS: Win 7 x64
CoreDX DDS: 3.4.0_rc4-Android_2.2_armv5_gcc44-Evaluation and 3.4.0_rc4-Windows_x86_vs2008-Evaluation
Java: jdk1.6.0_26 and jre6
Device: Galaxy Tab GT-P1000 with Android 2.3.3
Build target: Platform 2.2 API Level 8
Environment variables:
COREDX_HOST: Windows_x86_vs2008
COREDX_TARGET: I´ve tried Windows_x86_vs2008 and Android_2.2_armv5_gcc44
COREDX_TOP: C:\coredx
TWINOAKS_LICENSE_FILE: C:\coredx\XXX.lic
Thank you in advance,
Rafael
Comments
RE: Application stopped unexpectedly on Android Platform
Are you trying to build the 'tocshapes_android' example code? If so, there are some scripts to help complete the configure/build/install process.
If you are not using these scripts, then you will need to ensure that several components are included in the appropriate directory in your APK file: [Also, you should use COREDX_TARGET=Android_2.2_armv5_gcc44]
1) the CoreDX DDS native library (${COREDX_TOP}/target/${COREDX_TARGET}/lib/libdds_java.so) should be in libs/armeabi directory
2) the CoreDX DDS jar (${COREDX_TOP}/target/java/coredx_dds.jar) should be in the libs/ directory
3) a valid license file (for the evaluation build) must be present in the assets/ directory.
If these don't help, you can use 'logcat' on the device (using 'adb'). This might reveal why the application is exiting.
Are you running on a real device or an emulator?
Unable to obtain a valid license...
Hi,
Now my application is almost working, but when I try create a participant I get the message "COREDX: ERROR :Unable to obtain a valid license...".
My license (which is valid) is at assets/ directory and I my application reads the license file and sets it on DPF.
Here is the code that do it (I´ve copied from tocshapes_android example):
// open CoreDX DDS license file:
BufferedReader br = null;
String license = new String("<");
try {
br = new BufferedReader(new InputStreamReader(getAssets().open("coredx_dds.lic")));
} catch (IOException e) {
Log.e("Hello App", e.getMessage());
}
if (br != null) {
String ln;
try {
while ((ln = br.readLine()) != null) {
license = new String(license + ln + "\n");
}
} catch (IOException e) {
Log.e("Hello App", e.getMessage());
}
}
license = new String(license + ">");
dpf = DomainParticipantFactory.get_instance(); // get DomainParticipantFactory
ReturnCode_t code = dpf.set_license(license); // configure DPF with the license string
dp = dpf.create_participant(0, DDS.PARTICIPANT_QOS_DEFAULT, null, 0);
The license string seems to be OK and the ReturnCode_t is "RETCODE_OK".
With this same University License file I can run Java applications on computer without this license problem.
What could I be doing wrong?
Thank you in advance,
Rafael
CoreDX DDS license for Android
Using the code to load a license string into an application and then calling set_license() to install it should work. However, you will need to ensure that the license file complies with certain rules:
1) There should be only one line in the file
2) The line should start with LICENSE and continue to the end of the SIG hash code.
3) If the license includes an OS feature, it must be OS=Android_2.2
4) If the license includes a CPU feature, it must be CPU=armv5
5) If the license includes a PRODUCT feature, it must be PRODUCT=coredx_c (a run-time license)
Make sure that you select the appropriate "LICENSE ..." line from your licenses based on the info above.
Alternatively, you can paste a "LICENSE ..." line directly into your application code instead of reading from a file...
Pass it as an argument to set_license() -- just remember to put '<' and '>' around the line. For example:
dpf.set_license("<LICENSE PRODUCT=coredx_c BUILD=Evaluation EXP=[date] CUSTOMER=[...] OS=Android_2.2 CPU=armv5 COMPILER=any ... SIG=AAAAA......>");
I hope this helps!
The application is the
The application is the hello_java example with some minor changes and I´m running on a real device, Galaxy Tab GT-P1000.
These days I am going to try these steps and let you know if they worked or not.
Thank you so much,
Rafael