25045

under gluon project how to get the Android assets folder

Question:

I had creat a gluon project ,then I put some folders and files under assets folder(Android) and I want to read the files in application,now how do I can read the assets folder ? or how do I get the android Context or AssetManager ? under gluon project there is no Activity class or any class extends Activity.I had read all of the gluonMobile API, javaFXports API and developer docs, there is no help! Dose anyone can help me? I nearly got crazy!

Answer1:

FXActivity which you obtain via FXActivity.getInstance extends Activity, thus you can call fxActivity.getAssets() to get an instance of AssetManager

Recommend

  • Adding non-android xml file to android project
  • libGDX: 3d animation not working
  • Unable to create folder inside Android/data
  • ggplot2: Plotting regression lines with different intercepts but with same slope
  • Recreate Apple Watch fitness tracker ‘progress’ bar - gradient on CAShapeLayer stroke
  • Complex Silverlight TreeView, is nested hierarchy possible?
  • EditText is covered by Keyboard
  • Django Haystack Rebuild Index
  • Does Apportable support to build library binary (.a/.so)?
  • How to set elevation color?
  • URLConnection doesn't work since API 10 and higher?
  • Android Studio 1.3 RC3. Google Play services out of date. Requires 7571000 but found 6774470
  • Elasticsearch script query involving root and nested values
  • Android app gives error “BatteryStatsImpl: reading network stats”
  • Why use database factory in asp.net mvc?
  • How do I configure context broker accept post requests from my remote sensor?
  • Jenkins: FATAL: Could not initialize class hudson.util.ProcessTree$UnixReflection
  • Problems compiling files using JOGL
  • Unity3D & Android: Difference between “UnityMain” and “main” threads?
  • Switching to Release Build causes runtime error in Web Reference
  • Disable Enter in editText android
  • Cannot resolve symbol 'MyApi'
  • Paperclip, set path outside of rails root folder
  • If I include Java 8 in my Android app does that affect which devices it will work on?
  • C# - Serializing and deserializing static member
  • Opengl-es onTouchEvents problem or a draw problem? [closed]
  • Javascript Callbacks with Object constructor
  • Sending data from AppleScript to FileMaker records
  • Release, debug version and Authorization Google?
  • QuartzCore.framework for Mono Develop
  • InvalidAuthenticityToken between subdomains when logging in with Rails app
  • How to include full .NET prerequisite for Wix Burn installer
  • Proper folder structure for lots of source files
  • SQL merge duplicate rows and join values that are different
  • Load html files in TinyMce
  • LevelDB C iterator
  • Is it possible to post an object from jquery to bottle.py?
  • unknown Exception android
  • Can't mass-assign protected attributes when import data from csv file
  • Append folder name and increment by 1 using batch script