OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Can't access to assets in Android


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
jovo
Newbie


Joined: 11 Jul 2018
Posts: 1

PostPosted: Wed Jul 11, 2018 1:40 pm    Post subject:
Can't access to assets in Android
Reply with quote

Hi everyone,

I just compiled the example project for Android (osgAndroidExampleGLES2) and can't figure out how to load osgt files I've put inside the apk (assets folder).

I'm trying to load cow.osgt using the load option that appears in the app's menu with no luck (no matter what path I give). The error message appearing in logcat is:

-----------------------------------------
E/Osg Viewer: There are 1 models to load
Loading: cow.osgt
W/Osg Viewer: Error reading file cow.osgt: file not found
E/Osg Viewer: Model not loaded
-----------------------------------------

The file is located inside the assets folder in the apk root: /assets/cow.osgt

I tried these paths when loading:
assets/cow.osgt
/assets/cow.osgt
cow.osgt
/cow.osgt

The last thing I tried after read a solution in another topic on this forum is to copy the file cow.osgt to the external sdcard and set read permissions in the manifest but still appears the same error (file not found). The path I used for this was /storage/emulated/0/cow.osgt (anyway, I don't want to use the sd card in my app)

Any ideas on why is this happening?

Thank you, in advance!

Cheers,
j
Back to top
View user's profile Send private message
kornerr
Appreciator


Joined: 01 Oct 2013
Posts: 268

PostPosted: Thu Jul 12, 2018 10:13 am    Post subject:
Can't access to assets in Android
Reply with quote

Hi.

In OpenSceneGraph cross-platform guide application I first unpacked
the resource into local drive, then accessed it the usual way.
Here's the sample:
https://github.com/OGStudio/openscenegraph-cross-platform-guide-application/blob/master/android/app/src/main/java/org/opengamestudio/osgapp/RenderActivity.java#L27

On 11 July 2018 at 16:40, Daniel Ponsoda <> wrote:
Quote:
Hi everyone,

I just compiled the example project for Android (osgAndroidExampleGLES2) and can't figure out how to load osgt files I've put inside the apk (assets folder).

I'm trying to load cow.osgt using the load option that appears in the app's menu with no luck (no matter what path I give). The error message appearing in logcat is:

-----------------------------------------
E/Osg Viewer: There are 1 models to load
Loading: cow.osgt
W/Osg Viewer: Error reading file cow.osgt: file not found
E/Osg Viewer: Model not loaded
-----------------------------------------

The file is located inside the assets folder in the apk root: /assets/cow.osgt

I tried these paths when loading:
assets/cow.osgt
/assets/cow.osgt
cow.osgt
/cow.osgt

The last thing I tried after read a solution in another topic on this forum is to copy the file cow.osgt to the external sdcard and set read permissions in the manifest but still appears the same error (file not found). The path I used for this was /storage/emulated/0/cow.osgt (anyway, I don't want to use the sd card in my app)

Any ideas on why is this happening?

Thank you, in advance!

Cheers,
j

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74309#74309








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Android can't build osgdb_png lyn General [forum] 6 Fri Jun 29, 2018 2:35 am View latest post
No new posts setAxisAlignment(osgText::Text::SCREE... OmegaDoom General 1 Tue Jun 26, 2018 9:40 pm View latest post
No new posts osgEarth Android (and iOS) Chris Hanson General 0 Mon Jun 25, 2018 11:08 pm View latest post
No new posts Cross-platform examples for Linux, ma... kornerr Announcement [ANN] 3 Mon Apr 09, 2018 9:36 am View latest post
No new posts osg and the latest android ndk 27 Trajce Nikolov NICK General 0 Sat Mar 10, 2018 1:39 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP