lawang code

lawang Code


Tanyakan kode disini

base64 di android

ditanyakan oleh adhit 4 tahun yang lalu

mastah...., langsung aja ya..., koding dibawah ini kok decodenya gamau ya mastah???

Random rand2 = new Random(System.currentTimeMillis()*10);
        BigInteger gval = BigInteger.probablePrime(512, rand2);

        System.out.println(gval);

        String encoded = new String(Base64.encodeBase64(gval.toByteArray()));
        System.out.println(encoded);

        BigInteger decoded = new BigInteger(Base64.decodeBase64(encoded));
        System.out.println(decoded);


ini lognya :

12-12 12:41:42.098: I/dalvikvm(309): Could not find method org.apache.commons.codec.binary.Base64.decodeBase64, referenced from method com.example.test64.MainActivity$1.onClick 12-12 12:41:42.098: W/dalvikvm(309): VFY: unable to resolve static method 4968: Lorg/apache/commons/codec/binary/Base64;.decodeBase64 (Ljava/lang/String;)[B 12-12 12:41:42.098: D/dalvikvm(309): VFY: replacing opcode 0x71 at 0x003a 12-12 12:41:42.098: D/dalvikvm(309): VFY: dead code 0x003d-005c in Lcom/example/test64/MainActivity$1;.onClick (Landroid/view/View;)V 12-12 12:41:44.478: I/System.out(309): 10996135152252200575163547709768635000871488809565176492074866875805771372512710727634427712739564755925372074821257735442391548077746558374763957489246627 12-12 12:41:44.478: I/System.out(309): encode= ANHz/TAbjqgINUIIO8i8x77lNQIJFOPg2yv+XzEnze1B35EgfgoXFvbwcH9vJEcaoP9wpQ0z6n0o7cq7XNf8IaM= 12-12 12:41:44.488: D/AndroidRuntime(309): Shutting down VM 12-12 12:41:44.488: W/dalvikvm(309): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 12-12 12:41:44.498: E/AndroidRuntime(309): FATAL EXCEPTION: main 12-12 12:41:44.498: E/AndroidRuntime(309): java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.decodeBase64 12-12 12:41:44.498: E/AndroidRuntime(309):     at com.example.test64.MainActivity$1.onClick(MainActivity.java:36) 12-12 12:41:44.498: E/AndroidRuntime(309):   at android.view.View.performClick(View.java:2408) 12-12 12:41:44.498: E/AndroidRuntime(309):    at android.view.View$PerformClick.run(View.java:8816) 12-12 12:41:44.498: E/AndroidRuntime(309):    at android.os.Handler.handleCallback(Handler.java:587) 12-12 12:41:44.498: E/AndroidRuntime(309):   at android.os.Handler.dispatchMessage(Handler.java:92) 12-12 12:41:44.498: E/AndroidRuntime(309):   at android.os.Looper.loop(Looper.java:123) 12-12 12:41:44.498: E/AndroidRuntime(309):   at android.app.ActivityThread.main(ActivityThread.java:4627) 12-12 12:41:44.498: E/AndroidRuntime(309):     at java.lang.reflect.Method.invokeNative(Native Method) 12-12 12:41:44.498: E/AndroidRuntime(309):  at java.lang.reflect.Method.invoke(Method.java:521) 12-12 12:41:44.498: E/AndroidRuntime(309):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 12-12 12:41:44.498: E/AndroidRuntime(309):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 12-12 12:41:44.498: E/AndroidRuntime(309):  at dalvik.system.NativeStart.main(Native Method)

kira kira kenapa ya itu mastah??? bingung ane

Menampilkan 1-2 dari 2 hasil
handita okviyanto menjawab 4 tahun yang lalu :

coba download codec dari sini ...

http://commons.apache.org/proper/commons-codec/

Tambahkan di classpath di project androidnya


adhit menjawab 4 tahun yang lalu :

iya mastah..., trnyata kurang common-codec.jar hehehe...., tengkiuuuu


Anda harus login terlebih dahulu untuk memberikan komentar

Recent Tag

X 6
X 48
X 14
X 10
X 1
X 5
X 4
X 15
X 10

Bantuan

Help

Feedback

Help