git-printa / osmbonuspack

Automatically exported from code.google.com/p/osmbonuspack
0 stars 0 forks source link

force closed when read kml from file #47

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.I have 2 project:
2.project 1:it grabs the route shape overlay in KML structure 
3.project 2:it loads my_routes.kml on map

What is the expected output? What do you see instead?
I expected to see the my_routes.kml overlay on my device but it just shown on 
emulator . on device it force closed .

What version of the product are you using?
As you recommended me, i use OSMBonusPack v4.2.4, and osmdroid v4.0 .
i test project on galaxy ace with android2.3.6 and and galaxy younge with 
android 4.1 

Please provide any additional information below.
I copied the my_routes.kml in kml folder on my device

Original issue reported on code.google.com by arabi.gh...@gmail.com on 9 Jan 2014 at 6:53

GoogleCodeExporter commented 8 years ago
Have you exported your application as a "signed application package" (Android 
Tools/Export Signed Application Package)? This is usually required to have the 
app working properly on a device. 

Are you able to plug your device on your ADT (with USB), and get the logcat 
stacktrace? 

Original comment by mathieu....@gmail.com on 9 Jan 2014 at 8:51

GoogleCodeExporter commented 8 years ago
i don't export my application as a "signed application package" . The app works 
when read from url but when i changed the code to read from file has stopped 
with this error : fatal exception .(pluged my device on myADT (with USB)and get 
the logcat stacktrace)
 boolean ok = kmlDocument.parseUrl(url);---->(it works on my device and show the kml)
//------------
File file = kmlDocument.getDefaultPathForAndroid("my_routes.kml");
boolean ok = kmlDocument.parseFile(file);---->(it is force closed on device)
//------------
File path = new File(Environment.getExternalStorageDirectory(), "kml");
path.mkdir();
File file = new File(path.getAbsolutePath(), "my_routes.kml");
boolean ok = kmlDocument.parseFile(file);----->(it is force closed on device)

Original comment by arabi.gh...@gmail.com on 10 Jan 2014 at 10:31

Attachments:

GoogleCodeExporter commented 8 years ago
Interesting : 
Your stacktrace doesn't show a force close in parseFile, but in buildOverlays. 
It is a ResourceNotFoundException, apparently when inflating the bubble layout. 
=> Are you sure to have in your project ALL resources needed for the bubble? 
(Refer to the Tutorial_1)

Note that I always have troubles on the device when I don't install a signed 
application package. It could also be the cause. 

Original comment by mathieu....@gmail.com on 10 Jan 2014 at 11:33

GoogleCodeExporter commented 8 years ago
you are right i have not added the resources in the project . thank you so
much. it shows my_routes.kml now.
Thank you.

Original comment by arabi.gh...@gmail.com on 10 Jan 2014 at 1:30

GoogleCodeExporter commented 8 years ago
Fine!

Don't hesitate to drop a comment in ApplicationsUsingOSMBonusPack wiki page, to 
speak about your project and its usage of OSMBonusPack: this is the method to 
"retribute" the developer...

Original comment by mathieu....@gmail.com on 10 Jan 2014 at 9:01

GoogleCodeExporter commented 8 years ago
sure, many thanks for your help and guidance . the tutorials were perfect
from the first step to the last that i got your final comment . I hope be
able to learn more from your lessons.
thanks and best regards

Original comment by arabi.gh...@gmail.com on 11 Jan 2014 at 7:53