Android Tips and Tricks: Difference between revisions

From WickyWiki
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
= Allow apps read/write on sdcard =
= Allow apps read/write on sdcard =


SDFix works for Kitkat and Lollipop, you need root privileges
SDFix works for KitKat (4.x) and Lollipop (5.x), you need root privileges
* http://forum.xda-developers.com/shield-tablet/general/fix-ext-sd-write-support-2-0-lollipop-t2946250
* http://forum.xda-developers.com/shield-tablet/general/fix-ext-sd-write-support-2-0-lollipop-t2946250



Latest revision as of 20:47, 8 August 2016


Allow apps read/write on sdcard

SDFix works for KitKat (4.x) and Lollipop (5.x), you need root privileges

Rotate the Android Virtual Device (AVD)

CTRL+F11/F12

Debug a service

The the Eclipse debugger will not be able to connect to the Android debugger (ADB) for a service because there is no Main activity in the service. Such a process is started by the Android system (for example an account sync). To connect the code to the debugger add the following to your project and make sure it is traversed at an early stage:

//TODO: wjv: remember to remove this for the final code for performance considerations

//show a message to remind you it is in here
Toast toast =  Toast.makeText(getApplicationContext(), "waitForDebugger()", Toast.LENGTH_LONG);
toastv.show();

//wait for the debugger
android.os.Debug.waitForDebugger();

Android target version

Set target, like 16=4.1.2, 17=4.2.2, 18=4.3 in:

  • modify AndroidManifest.xml
  • modify project.properties
  • Project - clean

Eclipse hint color, javadoc background

On my version of Ubuntu the Javadoc background would be black, the blue links in the dialog are then difficult to read. Unfortunately, changing this in Eclipse did not work: (Window>Preferences>General>appearance>Colors and Fonts>Java) We can however change the hint colors of the Ubuntu OS to an acceptable yellow:

#backup
sudo cp /usr/share/themes/Ambiance/gtk-3.0/settings.ini /usr/share/themes/Ambiance/gtk-3.0/settings.ini.backup
sudo cp /usr/share/themes/Ambiance/gtk-3.0/gtk.css /usr/share/themes/Ambiance/gtk-3.0/gtk.css.backup
sudo cp /usr/share/themes/Ambiance/gtk-2.0/gtkrc /usr/share/themes/Ambiance/gtk-2.0/gtkrc.backup

#foreground text white => black
sudo sed -i s/tooltip_fg_color:#ffffff/tooltip_fg_color:#000000/g  /usr/share/themes/Ambiance/gtk-3.0/settings.ini /usr/share/themes/Ambiance/gtk-3.0/gtk.css /usr/share/themes/Ambiance/gtk-2.0/gtkrc

#background color black => yellow
sudo sed -i s/tooltip_bg_color:#000000/tooltip_bg_color:#f5f5b5/g  /usr/share/themes/Ambiance/gtk-3.0/settings.ini /usr/share/themes/Ambiance/gtk-3.0/gtk.css /usr/share/themes/Ambiance/gtk-2.0/gtkrc
  • logout
  • login