Just to confirm, so this basic capability in Android isn’t available in Corona SDK? ie adding stuff to the manifest and some simple lines of code that check for how the app is launched to detect the file path? Just like the iOS version of the Corona article does.
This Manifest is used to register (for example) .stl file type with your application:
\<?xml version="1.0" encoding="utf-8"?\> \<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.test.core" android:versionCode="1" android:versionName="1.0"\> \<application android:icon="@drawable/icon" android:label="@string/app\_name"\> \<activity android:name=".Testy" android:label="@string/app\_name"\> \<intent-filter\> \<action android:name="android.intent.action.MAIN" /\> \<category android:name="android.intent.category.LAUNCHER" /\> \</intent-filter\> \</activity\> \<activity android:name="ThorActivity" android:label="@string/app\_name"\> \</activity\> \<activity android:name="LokiActivity" android:label="@string/app\_name"\> \</activity\> \<activity android:name="OdinActivity" android:label="@string/app\_name"\> \<intent-filter\> \<action android:name="android.intent.action.VIEW" /\> \<category android:name="android.intent.category.DEFAULT" /\> \<category android:name="android.intent.category.BROWSABLE" /\> \<data android:scheme="http" android:host="\*" android:pathPattern=".\*\\.stl" /\> \<data android:scheme="https" android:host="\*" android:pathPattern=".\*\\.stl" /\> \<data android:scheme="content" android:host="\*" android:pathPattern=".\*\\.stl" /\> \<data android:scheme="file" android:host="\*" android:pathPattern=".\*\\.stl" /\> \</intent-filter\> \</activity\> \</application\> \<uses-permission android:name="android.permission.INTERNET" /\> \<uses-permission android:name="android.permission.BLUETOOTH" /\> \<uses-permission android:name="android.permission.BLUETOOTH\_ADMIN" /\> \<uses-permission android:name="android.permission.READ\_PHONE\_STATE" /\> \<uses-permission android:name="android.permission.ACCESS\_NETWORK\_STATE" /\> \<uses-permission android:name="android.permission.WRITE\_EXTERNAL\_STORAGE" /\> \</manifest\>
We link the .stl file extension to the activity OdinActivity. Inside the OdinActivity, the following line is used to get the file path so it open it:
filePath = getIntent().getData().getEncodedPath();
Then just open it to read from it:
FileOutputStream out = new FileOutputStream(new File(filePath));