Hi guys,
Just to share as I had difficulties looking for the solution.
To access and display images stored in Corona’s folder (where main.lua is stored), you can use the FileServices.
https://docs.coronalabs.com/daily/native/android/html/com/ansca/corona/storage/FileServices.html
Sample Code :
//Setup Context coronaApplication = CoronaEnvironment.getApplicationContext(); FileServices fileServices = new FileServices( coronaApplication ); // Dummy imageView ImageView topPanel = new ImageView(this); // Check whether file exist boolean doesAssetFileExist = fileServices.doesAssetFileExist("test.png"); // Get the image. This image will be automatically copied from Corona to Android's assets folder byte[] bytes = fileServices.getBytesFromFile( "test.png"); Bitmap bmp = BitmapFactory.decodeByteArray(bytes, 0, bytes.length); topPanel.setImageBitmap( bmp); // Other misc items which should be customised if you want to use it double tpImageWidth = topPanelHeight \* 0.8 ; FrameLayout.LayoutParams topPanelLayoutParams = new FrameLayout.LayoutParams((int) tpImageWidth, (int) tpImageWidth, Gravity.TOP ); topPanelLayoutParams.setMargins(10, (topPanelHeight - (int) tpImageWidth) / 2, 0, 0); topPanel.setLayoutParams(topPanelLayoutParams); FrameLayout preview = (FrameLayout) findViewById(R.id.layoutFile); preview.addView(topPanel); // Listener to CLOSE / BACK topPanel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { // Toast.makeText( getApplicationContext(), "ImageButton is clicked!", Toast.LENGTH\_SHORT).show(); Intent dataIntent = new Intent(); // dataIntent.putExtra( RESULT\_CANCELED, "Camera unavailable"); setResult(Activity.RESULT\_CANCELED, dataIntent); finish(); } });