Implemented on GIT Replace Android JNI with pure Java

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,135
By @grant on GH issues:

Why are the native libraries included in the Android target used instead of Java? They seem to only contain two small methods for parsing numbers from strings. It would be nice to see it be pure Java on Android, so it'll be compatible with any possible processor architecture that comes out in the future


Replacing the two native methods with Java's build in Integer.parseInt() and Float.parseFloat() doesn't seem to cause any problems with my test project. Rendering numbers in text worked. I don't understand why the native code exists.
LangUtil.java
Code:
package com.cerberus;

public class LangUtil{

    public static int parseInt( String str ) {
        return Integer.parseInt(str);
    }
    
    public static float parseFloat( String str ) {
        return Float.parseFloat(str);
    }
}
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,135
As nobody mentioned any problems, I moved it to the develop branch.
 
Top Bottom