Apache Cordova Hide Status Bar

[DRAFT]

To remove the status bar in iOS 7 use the following entries in the plist file.

<key>UIStatusBarHidden</key>

<true/>

<key>UIViewControllerBasedStatusBarAppearance</key>

<false/>

In the configuration on XCode the following achieves the same

set
Status bar is initially hidden = YES

add row: View controller-based status bar appearance = NO

 

Edit .plist file for the iOS build by adding:

UIStatusBarHidden = true

UIViewControllerBasedStatusBarAppearance = false

 

First, we need to note this only works on Cordova (recommend v3.3.1) or another native UIWebViewwrapper. If we use Cordova, we will need to install one plugin:

$ cordova plugin add org.apache.cordova.statusbar

Then, we will use Ionic’s Platform service to listen for the device ready event and remove the status bar:

angular.module(‘myApp’, [‘ionic’])

 

.controller(‘MyCtrl’, function($scope, Platform) {


Platform.ready(function() {


// hide the status bar using the StatusBar plugin


StatusBar.hide();

});

});

 

 

My app.js

if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
}
if (window.StatusBar) {
// org.apache.cordova.statusbar required
StatusBar.hide();
StatusBar.styleDefault();
}

 

 

 

For API level 19:

In addition to setting the fullscreen flag, I also had to add the following to hide the soft keys:

View decorView = getWindow().getDecorView();

// Hide both the navigation bar and the status bar.
					

// SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
					

// a general rule, you should design your app to hide the status bar whenever you
					

// hide the navigation bar.
					

int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION

              | View.SYSTEM_UI_FLAG_FULLSCREEN;

decorView.setSystemUiVisibility(uiOptions);
					

https://developer.android.com/training/system-ui/navigation.html

You can also set the sticky immersion as described here:https://developer.android.com/training/system-ui/immersive.html

 

 

This is how I do it – hides the title and makes it full screen:

// requesting to turn the title OFF

requestWindowFeature(Window.FEATURE_NO_TITLE);


// making it full screen

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

I also have this in my AndroidManifest under Application:

android:theme=“@android:style/Theme.NoTitleBar.Fullscreen”

 

 

References

 

http://stackoverflow.com/questions/21395416/cordova-how-do-you-hide-the-status-bar-on-the-splash-launch-screen

http://ionicframework.com/tutorials/fullscreen-apps/

https://forum.ionicframework.com/t/status-bar-not-hidden-in-spash-screen-in-android/38976

http://stackoverflow.com/questions/20678024/how-to-hide-navigation-bar-in-android-app-code/20680323#20680323

Universal App with Visual Studio 2015 tools for Apache Cordova – Android Distribution

Practical steps to create universal app with VS2015. Based on the oryginal post by Authored by Norm Estabrook with contributions from Raghav Katyal, Mikejo5001, rido-min,Linda Z with comments.

Before starting the process, make sure that VS has the latest updates.

Create new app

Use VS2015 wizard to create blank application

Note! Make sure there are no blank spaces in the project’s location!

Package the Android version of your app

In this section:

  • Modify the settings of your app.
  • Generate a private key.
  • Refer to that key in a configuration file.
  • Create the package.

Step 1: Modify the settings of your app

The general settings of your app appear in the Common page of the configuration designer.

  • The Display Name is the name that appears in the app store.
  • The Package Name is a string that uniquely identifies your app.

    Choose a naming scheme that reduces the chance of a name conflict.

  • The Domain Access collection lists the domains that your app needs to access.

    For example, the WeatherApp that appears in the previous image, obtains weather data from a service endpoint that has the domain https://query.yahooapis.com.

The purpose of most other settings clear from the title, but you can find more information about them here: The config.xml File.

Android-specific settings appear in the Android tab of the configuration designer.

You can read about each option in the preference section of the config.xml reference topic.

Step 2: Generate a private key

To sign your app, create a keystore. A keystore is a binary file that contains a set of private keys. Here’s how you create one.

  1. Open a Command Prompt in administrator mode.
  2. In the Command Prompt, change directories to the %JAVA_HOME%\bin folder.

    (For example: C:\Program Files (x86)\Java\jdk1.7.0_55\bin).

  3. In the Command Prompt, run the following command.
  4. keytool -genkey -v -keystore c:\my-release-key.keystore -alias johnS
    

    [/code][/code]

  5. Plain Text>Plain Text>-keyalg RSA -keysize 2048 -validity 10000
    

    Replace my-release-key.keystore and johnS with names that make sense to you.[/code][/code]

  6. Plain Text>Plain Text>Plain Text>You'll be asked to provide a password and the Distinguished Name fields for your key.
    This series of responses gives you an idea of the kinds of information you'll provide for each prompt. Like in the previous command, respond to each prompt with information that makes sense for your app.
    Plain Text>Enter keystore password: pwd123
    

    Plain Text>Re-enter new password: pwd123
    [/code]PHP>What is your first and last name?
    [/code]PHP>[Unknown]= John Smith
    [/code]PHP>What is the name of your organizational unit?
    [/code]PHP>[Unknown]= ABC
    [/code]PHP>What is the name of your organization?
    [/code]PHP>[Unknown]= XYZ
    [/code]

    Plain Text>PHP>What is the name of your of your City or Locality?
    PHP>[Unknown]= Redmond
    [/code]
  7. Plain Text>Plain Text>key.alias=johnS
    

    [/code][/code]

  8. Plain Text>[/code]
  9. Plain Text>Plain Text> "android": {
    

    [/code][/code]

  10. Plain Text>Plain Text>Plain Text>Plain Text>     "release": {
    

    [/code][/code]

  11. Plain Text>Plain Text>Plain Text>Plain Text>Plain Text>Plain Text>         "keystore":"c:\\my-release-key.keystore",
    

    [/code][/code]

  12. Plain Text>Plain Text>Plain Text>Plain Text>Plain Text>Plain Text>         "storePassword":"pwd123",
    
  13. Plain Text>Plain Text>Plain Text>         "alias":"johnS",
    
  14. Plain Text> "password":"pwd123",
  15. "keystoreType":""
  16. }
  17. }
  18. }

Step 4: Create the package

  1. On the Standard toolbar, choose the Android platform.
  2. Choose the Release build configuration.
  3. Choose one of the Android emulators.

    .

    Important: Don't choose any of the Ripple simulators. Choose only an Android emulator or the Device.

  4. On the Build menu, choose Build Solution.

    This builds a file with an .apk file extension. That is the file that you'll upload to the store.

    You can find that file in the bin/Android/Release/ folder of your project.

    It's the file that does not contain the word unaligned in the file name.

Submit your app to the store

You can publish your app to Google Play.

To prepare for the big day, review Essentials for a Successful App.

Then, see Upload an app to make your app avaialable to the world.

 

References:

https://taco.visualstudio.com/en-us/docs/tutorial-package-publish-readme/

 

Resize RaspberryPi.img file

This article describes how to truncate oversized .img file

Command (on linux):

# truncate -s 4000M RSE1g.img<br></p><h1>Check file size:</h1><p>ls -l --block-size=M<br></p><h1>Make a copy of the file</h1><p>cp old.img new.img

 

Truncate command references

NAME

truncate – shrink or extend the size of a file to the specified size

SYNOPSIS

truncate OPTIONFILE

DESCRIPTION

Shrink or extend the size of each FILE to the specified size

A FILE argument that does not exist is created.

If a FILE is larger than the specified size, the extra data is lost.

If a FILE is shorter, it is extended and the extended part (hole) reads as zero bytes.

Mandatory arguments to long options are mandatory for short options too.

-c, –no-create

do not create any files

-o, –io-blocks

treat SIZE as number of IO blocks instead of bytes

-r, –reference=RFILE

base size on RFILE

-s, –size=SIZE

set or adjust the file size by SIZE bytes

–help display this help and exit

–version

output version information and exit

The SIZE argument is an integer and optional unit (example: 10K is

10*1024). Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,…

(powers of 1000).

SIZE may also be prefixed by one of the following modifying

characters: ‘+’ extend by, ‘-‘ reduce by, ‘<‘ at most, ‘>’ at least,

‘/’ round down to multiple of, ‘%’ round up to multiple of.

Changing size of the partitions on .img file

Before .img file can be truncated, make sure, that the partitions fit on the resized file.

Use GParted to resize the partitions.

References:

[1] http://www.htpcguides.com/easy-resize-and-back-up-raspberry-pi-sd-card-with-ubuntu/
[2] http://blog.gbaman.info/?p=328