Questions tagged [android-assetmanager]

31 questions
6
votes
2 answers

How to use Asset Manager API in NDK to read raw data?

I have shaders kept in assets folder. name of the shader (file name) : "vertex.vs" path : assets/shaders/vertex.vs I want to access this file from a C++ file from NDK without calling Java or JNI whatever it is. From reading various resources I…
Rahul Naik
  • 105
  • 1
  • 9
3
votes
0 answers

Android AssetManager Timeout Exception

We have recently started experiencing a lot of AssetManager Timeout Exception. Fatal Exception: java.util.concurrent.TimeoutException: android.content.res.AssetManager$AssetInputStream.finalize() timed out after 10 seconds at…
Gaurav
  • 667
  • 2
  • 13
  • 28
3
votes
1 answer

open a file outside of assets folder by assetManager

I have a binary file in root of apk and I can check it by: AssetManager assets = Context().getResources().getAssets(); assets.list("/") It exists in returning list. But how can I open it? Because when I try to open the file by using this…
hich9n
  • 1,578
  • 2
  • 15
  • 32
3
votes
2 answers

How to get AssetManager from a library project

I am trying to get AssetManager form a class in an Android library project, but I am getting the error: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources…
Program-Me-Rev
  • 6,184
  • 18
  • 58
  • 142
1
vote
0 answers

Using react-native-video to read the video from android asset folder

I am using react-native-video to play videos and it works well in React Native asset system. But in my case, I must to read the video from android asset folder. Does anyone can help me? Below are the paths I've tried, but unfortunately none of them…
1
vote
0 answers

How to make HTML video elements buffer assets loaded with AssetManager

I am currently creating an App with Ionic. Because App Bundle sizes in the Google Playstore are limited to 150 MB I am using Play Asset Delivery to load bigger Assets like Images and Videos. I use Angulars typescript to interact with the HTML, but…
1
vote
1 answer

changing notification icon color in image asset in android studio

how can I change the color of notification icon in image asset? I wanted to use an icon from image asset to use as notification icon but I am finding no option as fill color(to change the color) to my latest android studio version, isn't it…
1
vote
2 answers

Android can't open file in assets folder

My app allows user to export its data to other users or just to save as backup. The import/export is working FINE In order to let the user have a sample data when it first installs my app I want to package some default data. I created the sample…
Rafael Lima
  • 3,079
  • 3
  • 41
  • 105
1
vote
1 answer

InputMismatchException when scanning

I'm doing an assignment trying to manipulate an array of ints (grades). It's crashing and I can't figure out why. I don't know if it has something to do with the file input, output? the error log seems to be saying it isn't even getting past running…
1
vote
1 answer

C++ android assetmanager reads files from app internal directory

I use AssetManager in C++ code to load my assets. But if there exists file with the same name in app internal directory AssetManager check it first and load it. Is it possible to set AssetManager to avoid files in internal app dir and check only…
1
vote
1 answer

Get FileChannel from AssetManager Android

I want to get a FileChannel from the AssetManager in Android, is there any way to do this? I want to map some raw custom binary files to some buffers. (If you have a better solution than using the AssetManager, please feel free to mention.
Ryan
  • 2,755
  • 16
  • 30
0
votes
1 answer

How to copy Asset folder content into internal storage in Xamarin.Android?

I need to copy the content in a folder located in Assets in my Xamarin.Android project. There are more than 10 files in my Content folder and I need to create a folder called Models in my application's data folder and copy the content into it. So I…
Randi
  • 639
  • 2
  • 6
  • 23
0
votes
0 answers

load file_a.html with internet, load file_b.html if there is no Internet

I am making an App in Android Studio. I am using webview. When someone opens the app, I want load file_a.html with internet from assets folder load file_b.html if there is no Internet from assets folder How to do this? I have written this code in…
0
votes
1 answer

Android studio fileFilter with assetManager

I have the following functionality to a desktop application with java and I want to do the same thing for a mobile application. File f = new File(pathToFiles); File[] files = f.listFiles(new FileFilter() { @Override public boolean accept(File…
0
votes
0 answers

When reading from InputStream to ByteBuffer.array(), first 4 bytes of data are dropped

Let me give a simplified version of what I've tried. I have a file asset that contains a raw array of numbers (total of N number each is 4 bytes wide). I make an InputStream using AssetManager and try to push all the data into a direct…
Alexey S. Larionov
  • 6,555
  • 1
  • 18
  • 37
1
2 3