Native method not found error on Android - java

For my bachelor thesis iam trying developing a JmonkeyGame.
4 weeks ago i read something about use a Character and use Physics ==> use BetterCharacterControl class.
Now my problem is that as soon as i implement statemanager.attach(bulletAppState):
#Override
public void simpleInitApp() {
bulletAppState = new BulletAppState();
stateManager.attach(bulletAppState);
initKeys();
initMouse();
initAudio();
createLight();
createTerrain();
createSky();
addPlayer();
addCamera();
}
I get an error on android.
I am developing in eclipse, not JME3-Programm because the game is only a part of the apk.
Libaries in eclipse:
JME3-android.jar, JME3-bullet.jar, JME3-core.jar
I have no idea where to look for a solution, or why this problem occours.
Help or tips to my problem would be fabulous.
Hardware:
Sony Compact D5503
Android V. 4.4.2
Android Screenshot of error:

Related

Anychart Android Java export chart as SVG or PNG in specific local folder

I was trying to create and save an image with AnyChart for an android application. This image is created without being rendered since the idea is to use the data from a vector to generate the image and save it on the phone's memory. I am using Java for programming the android application.
I have been testing the ".saveAsPng()" and ".saveAsSVG()" functions from the Anychart Library but there has been no success... I don't receive an error but I don't get the image either... and I don't know exactly how to proceed...
I tried to follow this guideline (https://docs.anychart.com/Common_Settings/Server-Side_Rendering) but as I said, I haven't succeeded in generating and saving the file.
This is the code that I have been using:
private class CustomDataEntry2 extends ValueDataEntry {
CustomDataEntry2(double x, Number value) {
super(x, value);
}
}
_
List<DataEntry> dataLateral = new ArrayList<>();
for (int p=0; p<DataX.size();p++) {
dataLateral.add(new CustomDataEntry2(DataY.get(p), DataX.get(p)));
}
AnyChartView anyChartViewLateral = new com.anychart.AnyChartView(this);
APIlib.getInstance().setActiveAnyChartView(anyChartViewLateral);
anyChartViewLateral.setProgressBar(new ProgressBar(this));
Polar polarLateralImage = AnyChart.polar();
polarLateralImage.startAngle(90);
Linear xScaleLateral = Linear.instantiate();
xScaleLateral.minimum(-180).maximum(180);
xScaleLateral.ticks().interval(90);
polarLateralImage.xScale(xScaleLateral);
Line polarSeriesLine = polarLateralImage.line(dataLateral);
polarSeriesLine.closed(false).markers(true);
polarSeriesLine.markers().size(3);
polarLateralImage.autoRedraw(true);
anyChartViewLateral.setChart(polarLateralImage);
polarLateralImage.saveAsPng(400,400,0.3,"testImage.png");
Could anyone tell me what am I missing or what amb I doing wrong? I know I might be asking too much, but if it were possible, I would be happy if someone could provide a code snippet that works.
Thank you very much!
Unfortunately, the current version of the AnyChart Android native library doesn't support exporting features, it was no implemented yet.

Unity AndroidJavaObject not working without showing errors

I have been trying to call a Java method in unity. Not working for me, even the simplest example from the docs
using System.Collections;
using UnityEngine;
public class ExampleClass : MonoBehaviour {
void Start () {
AndroidJavaObject jo = new AndroidJavaObject ("java.lang.String", "some string");
int hash = jo.Call<int> ("hashCode");
Debug.Log ("hash=" + hash);
}
}
Unity console prints hash=0, which is not the hash code for provided String. Even if I change and use java.lang.StringInvalidClass as class name, unity still reports same result to the console without notifying errors. I can even try to call toString, toStringa, toInvalid2 and they always return empty string without showing errors.
This is a brand new 2d project with only script displayed above, attached to camara object. I am using Ubuntu, Unity 2019.4 and project platform is Android.
Thanks for the assistance.
Answering myself after some time working with unity.
All examples in the web and unity documentation doesn't mention it, which is weird since it is something simple to mention and about confusions: code needs to run as an android application. Editor or even unity remote does not work, in order to use AndroidJavaObject and related classes, your code needs to run as an android application installed in the phone.

Where do I put "IInAppBillingService.aidl" in a LibGDX project?

I've been trying to get IAP to work with my LibGDX game for Android for over 6 hours. First I tried to use gdx-pay, but sadly the documentation for it is very unclear to me and was therefore not able to get it to work.
Because my games are only for Android (for now) gdx-pay was overkill anyway, so I decided to directly implement Google Play IAP. I found a tutorial that is pretty clear, but sadly it doesn't explain where I should put the IInAppBillingService.aidl file.
I tried putting it in a newly created directory in the Android directory, namely /android/vending/billing, but that doesn't seem to work and the directory also doesn't show when I have my project view on Android.
I also tried creating a new package "andoird.vending.billing" in the java directory where the game package with the AndroidLauncher is in but that doesn't work either.
With both these methods I'm not able to import the class IabHelper in the following tutorial code which is in AndroidLauncher.java located in my game's package:
String base64EncodedPublicKey = "xxx";
// compute your public key and store it in base64EncodedPublicKey
mHelper = new IabHelper(this, base64EncodedPublicKey);
mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {
public void onIabSetupFinished(IabResult result) {
if (!result.isSuccess()) {
// Oh noes, there was a problem.
Log.d("IAB", "Problem setting up In-app Billing: " + result);
}
// Hooray, IAB is fully set up!
Log.d("IAB", "Billing Success: " + result);
}
});
Where (and how) am I supposed to put the "IInAppBillingService.aidl" file to be able to import the IabHelper class in my LibGDX project? If you have a clearer tutorial on gdx-pay or on a technique similar to the one I'm using now I would also appreciate it.
Thanks in advance!

g3d.utils not (anymore) available?

Last week i tried to start coding with the libgdx library.
As i would like to try it's 3d context i rode the tutorial of Xoppa: http://blog.xoppa.com/basic-3d-using-libgdx-2/
Well, i understood his examples and started to code in eclipse.
But as soon as i got to the modelbuilder usage i stuck:
#Override
public void create() {
...
ModelBuilder modelBuilder = new ModelBuilder();
...
}
i imported a few other classes without problems, but i didn't find ...g3d.utils.modelbuilder
I googled and took a look at their github, where the package g3d.utils. exists.
And now, i don't know anymore. i'm using the latest stable build 0.9.8
I hope you can help me. Thanks for your time!
The new 3D API (which is what Xoppa has been working on) is only available in post-0.9.8 builds, which at the moment is the "nightly" builds: http://libgdx.badlogicgames.com/download.html

lwuit wizard and deploy

I am developing J2ME application with lwuit and Codenameone and created it in lots of time. After I created it I wanted to deploy it in some devices like Nokia, Samsung, LG and etc. that they supported MIDP. So I figure out Nokia devices run it with no error and Samsung and other companies devices have some problems that I can't understand why?!
So I tried different way of creating this application. I used Codenameone wizard with blank theme and manual template and then I tried to deploy it. Well, that right. I got success and it ran in Samsung devices too.
After that I tried to add some forms to "theme" in this appliaction and run it in simulator. I changed some code in my main class like this:
public class Main extends UIBuilder {
private Form current;
public void init(Object context) {
try{
Resources theme = Resources.openLayered("/theme");
UIManager.getInstance().setThemeProps(theme.getTheme(theme.getThemeResourceNames()[0]));
}catch(IOException e){
e.printStackTrace();
}
}
public void start() {
if(current != null){
current.show();
return;
}
Form hi = findMain();//new Form("Hi World");
//hi.addComponent(new Label("Hi World"));
hi.show();
}
public void stop() {
current = Display.getInstance().getCurrent();
}
public void destroy() {
}
public com.codename1.ui.Form findMain() {
return (com.codename1.ui.Form)findByName("Main", Display.getInstance().getCurrent());
}}
I got error when I ran it.
So this is my questions:
I created one application in Visual Mode of Codenameone.
How can I run it in Samsung and some other devices like Samsung (without opertaing system, just support java or MIDP)?
How can I change my Visual Mode application to Manual Mode in Codenameone?
Thanks in advance.
You are deriving from UIBuilder within the lifecycle class and trying to use a finder method on something that isn't showing yet. There is absolutely no way that your code works in the simulator and it is not the code that was generated by the wizard.
Thanks Shai. For creating I did hard coding and create all of forms one by one.
I implement base Form that derive from com.codenameone.ui.Form and every forms derive from base Form.

Categories