@@ -6,11 +6,31 @@ import commonTests = require("Tests/application-tests-common");
66declare var exports ;
77require ( "utils/module-merge" ) . merge ( commonTests , exports ) ;
88
9+ // <snippet name="application">
10+ // ### Using the Android-specific implementation
11+ // ``` JavaScript
12+ // Accessing the Android-specific object instance (will be undefined if running on iOS)
13+ var androidApp = app . android ;
14+ // ```
15+ // Using the Android Application context
16+ // ``` JavaScript
17+ var context = app . android . context ;
18+ //// get the Files (Documents) folder (directory)
19+ var dir = context . getFilesDir ( ) ;
20+ // ```
21+ // Tracking the current Activity
22+ // ``` JavaScript
23+ if ( androidApp . currentActivity === androidApp . startActivity ) {
24+ //// We are currently in the main (start) activity of the application
25+ }
26+ // ```
27+ // </snippet>
28+
929export var testAndroidApplicationInitialized = function ( ) {
1030 TKUnit . assert ( app . android , "Android application not initialized." ) ;
1131 TKUnit . assert ( app . android . context , "Android context not initialized." ) ;
1232 TKUnit . assert ( app . android . currentActivity , "Android currentActivity not initialized." ) ;
13- TKUnit . assert ( app . android . startActivity , "Android mainActivity not initialized." ) ;
33+ TKUnit . assert ( app . android . startActivity , "Android startActivity not initialized." ) ;
1434 TKUnit . assert ( app . android . nativeApp , "Android nativeApp not initialized." ) ;
1535 TKUnit . assert ( app . android . packageName , "Android packageName not initialized." ) ;
1636}
0 commit comments