Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2374] Android: Modules Should Support platform Folder

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-05-06T10:06:18.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.7.0, Sprint 2011-11
ComponentsAndroid
Labelsandroid, feature, release-1.7.0, tooling
ReporterDon Thorp
AssigneeBill Dawson
Created2011-04-15T03:18:08.000+0000
Updated2011-05-06T10:06:18.000+0000

Description

Some modules may want to ship resources to be merged into /res we should take care of that during install/build.

Attachments

FileDateSize
tifranzi-android-01.zip2011-04-15T03:18:08.000+0000137530

Comments

  1. Don Thorp 2011-04-15

    We are moving this to 1.5.1. If you run into the issue with a custom module or you publish a custom module. You will need to have the user of the module merge any Android resources into their platform/android/res/... folders and files as necessary for the module to perform.

  2. Bill Dawson 2011-04-15

    (from [42d21873eda3eb8076b61c38ce69d4d5bb4de53b]) Copy platform/ folder contents from app modules into build/android, for any modules that are used in an app. [#2374] https://github.com/appcelerator/titanium_mobile/commit/42d21873eda3eb8076b61c38ce69d4d5bb4de53b"> https://github.com/appcelerator/titanium_mobile/commit/42d21873eda3...

  3. Bill Dawson 2011-04-15

    (from [3a52eae800b9fdf07c6ae9031910464566dcf9d4]) When building module, put platform/ folder (if any) in the zip, but not in the jar (was doing the latter accidentally earlier). [#2374] https://github.com/appcelerator/titanium_mobile/commit/3a52eae800b9fdf07c6ae9031910464566dcf9d4"> https://github.com/appcelerator/titanium_mobile/commit/3a52eae800b9...

  4. Bill Dawson 2011-04-15

    Also this commit:

    https://github.com/appcelerator/titanium_mobile/commit/c8bb9ef1ba384e3c098ac9b58"> https://github.com/appcelerator/titanium_mobile/commit/c8bb9ef1ba38...

  5. Bill Dawson 2011-04-15

    For QE:

    • Create a new application.

    • In the app's tiapp.xml, add this to the <modules> section:

           <module platform="android" version="0.1">ti.franzi</module>
         
    • Copy the attached zip file (it's a test module) into the project's root folder.

    • Make this the project's app.js:

       Titanium.UI.setBackgroundColor('#000');
       var win = Titanium.UI.createWindow({  
           title:'Test',
           backgroundColor:'#000',
           exitOnClose: true,
           fullscreen: false
       });
       win.add(Ti.UI.createImageView({
           image: Ti.App.Android.R.drawable.fj,
           width:200, height:267
       }));
       win.open();
       
    • Run the app in Android. (No need to test iOS, because there are no uses of the platform/ folder in iOS projects and modules.)

    • When the app opens, you should see a photograph on the screen.

    Explanation

    The zip file you installed is an Android Titanium module. When it gets expanded into the modules/ folder in your project (which occurs automatically when the project is built), you'll see it has a platform/android/res/drawable/fj.png file in it. That png file is the photo you see when you run the app.

    So the photo file is not one of your project's Resources/ files, but rather comes from the external, installed ("third-party", if you want) module. If the photo successfully displays, it proves that the module's platform/ folder and its sub-contents were successfully merged into build/android when your app was built, which is the purpose of this ticket.

  6. Bill Dawson 2011-04-15

    I don't know if it matters (I don't think it does) but Lighthouse stripped dots out of the filename for that zip file attached here. the filename should be ti.franzi-android-0.1.zip. But I'm pretty sure it doesn't matter what the filename is. Just plop it in your project's root folder.

  7. Don Thorp 2011-05-06

    Tested on a Nexus One 2.3.4

JSON Source