Android Tips and Tricks: Difference between revisions

From WickyWiki
Created page with "Category:Android Category:201309 = Rotate the Android Virtual Device (AVD) = CTRL+F11/F12 = Debug a service = The the debugger will not be able to connect to a ser..."
 
Line 26: Line 26:
= Eclipse hint color, javadoc background =
= Eclipse hint color, javadoc background =


On Ubuntu the Javadoc background is black, links are difficult to read. Changing this in Eclipse: Window>Preferences>General>appearance>Colors and Fonts>Java does not work, it works if we change the hint colors for Ubuntu:
On Ubuntu the Javadoc background could be black, the blue links are difficult to read. Changing this in Eclipse does nor work: (Window>Preferences>General>appearance>Colors and Fonts>Java), we have to change the hint colors for the Ubuntu OS:


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
Line 34: Line 34:
sudo cp /usr/share/themes/Ambiance/gtk-2.0/gtkrc /usr/share/themes/Ambiance/gtk-2.0/gtkrc.backup
sudo cp /usr/share/themes/Ambiance/gtk-2.0/gtkrc /usr/share/themes/Ambiance/gtk-2.0/gtkrc.backup


#foreground white => black
#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
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 black => yellow
#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
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
</syntaxhighlight>
</syntaxhighlight>

Revision as of 19:14, 1 September 2013


Rotate the Android Virtual Device (AVD)

CTRL+F11/F12

Debug a service

The the debugger will not be able to connect to a service because there is no Main activity. Processes are started by the Android system at some point. To connect the code to the debugger add some code to your project that is executed at an early stage:

//TODO: wjv: remember to remove this for the final code
Toast toastwjv =  Toast.makeText(getApplicationContext(), "waitForDebugger", Toast.LENGTH_LONG);
toastwjv.show();
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 Ubuntu the Javadoc background could be black, the blue links are difficult to read. Changing this in Eclipse does nor work: (Window>Preferences>General>appearance>Colors and Fonts>Java), we have to change the hint colors for the Ubuntu OS:

#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