0

I'm trying to save image to mysql database. The image path is saved in the database, and the images are found in the project file but they can't open (Invalid). I think I can't save images from the Emulator to project file. There's some Error found.

 01-19 10:09:17.467: W/System.err(834): java.net.MalformedURLException: Protocol not  found: /mnt/sdcard/447650.jpg
 01-19 10:09:17.475: W/System.err(834):     at java.net.URL.<init>(URL.java:178)
 01-19 10:09:17.475: W/System.err(834):     at java.net.URL.<init>(URL.java:127)
 01-19 10:09:17.475: W/System.err(834):     at com.example.aa.MainActivity.JSONForUser(MainActivity.java:949)
 01-19 10:09:17.475: W/System.err(834):     at com.example.aa.MainActivity.Clickbtn_register(MainActivity.java:869)


01-19 10:09:17.555: E/AndroidRuntime(834): Caused by: java.lang.NullPointerException
01-19 10:09:17.555: E/AndroidRuntime(834):  at com.example.aa.MainActivity.JSONForUser(MainActivity.java:956)
01-19 10:09:17.555: E/AndroidRuntime(834):  at com.example.aa.MainActivity.Clickbtn_register(MainActivity.java:869)

Give me some advice!!!

Halo
  • 729
  • 1
  • 8
  • 18

1 Answers1

0

You must simply store image path to sqlite.It is not wise to save binary data in sqlite. You must follow this Android Save images to SQLite or SDCard or memory page to clear your doubts.

Have a good luck. Thanks

Community
  • 1
  • 1
M A.
  • 949
  • 2
  • 12
  • 29