Thursday, February 18, 2016

[Excel] Change the columns index from letter to number

When you open a spreadsheet by defautl the columns are indexed by letters: 

But if you want to change the format and put the index in numbers, here's how:
  • Open your spreadsheet
  • Click on the orb button
  • Click on Excel Options and move to the Formula tab.
  • Go to the "Working with formulas" section
  • Check the "R1C1 reference style"
  • Note that: Upon hovering your mouse cursor on it, you shall get all the information about this feature.
  • Click on OK

Tuesday, February 16, 2016

How to initialize Android program to be portrait or landscape

If you want to disable orientation changes of the phone then you may use this code in the manifest
<activity android:name=".class_name"
//if you want your screen in portrait
android:screenOrientation="portrait" >
//if you want you screen in landscape mode
android:screenOrientation="landscape" >
and if you want your phone to change orientation but prevent the process from restarting then you can use the onConfigurationChanged method in your class:
@Override
public void onConfigurationChanged(Configuration newConfig) {
   // ignore orientation change
   if (newConfig.orientation != Configuration.ORIENTATION_LANDSCAPE) {
       super.onConfigurationChanged(newConfig);
   }
}

Sunday, February 14, 2016

How to copy database file from android

Using Android Studio, click the android device button located in the toolbox menu
Then navigating to the storage folder under the name of your device (on the left panel)
The data is stored in one of the folder that your app pointed to (check your code for this location)