Select to view content in your preferred language

Load tiff map in Android Paltform

1971
1
12-27-2016 11:10 PM
vijaybasker
Deactivated User

Dear All,

i am using ArcGIS SDK for Android application, i have integrated with my android studio and created the new project.

I want to load tiff file from my desktop folder and the path has given in code as per ESRI referred link. But after compiling the project it throws null pointer exception and i am seeing empty emulator with out map. can you please suggest where is the problem?

i have attached the screenshot for your reference.

thanks and regards,

vijay.

0 Kudos
1 Reply
EricBader
Honored Contributor

It sounds like your emulator can't find the image file. Which makes sense, because the emulator doesn't know anything about your desktop's file system.

In your code, "Environment.getExternalStorageDirectory()" will give you your emulator's SD card root location (/storage/emulated/0 ....  or often just /sdcard/). If you want the emulator to find your image file there, you can  'push' your file from your desktop location to your emulator's virtual drive. Open a command window and use the adb command (found in your android SDK home) as follows:

adb -s <emulator name> push <local file on desktop> <remote file on emulator's sdcard>

For example:

adb -s <your emulator's name> push c:\images\my.tiff /sdcard/my.tiff

Now, you may need to refresh or restart your emulator. After that, your code should find your image file correctly.

I hope this helps you. Android Debug Bridge | Android Studio - this is a cool adb commandline reference, by the way.