Android Studio Shortcuts

I use a Mac for Android development, so apologies to the Linux and Windows users out there. You can find a list of similar shortcuts here.




  • ⌘ + Shift + O – Search by file name

  • ⌘ + B – Go to definition in code, layout files, XML values files…pretty much everywhere

  • Shift + F6 – Rename. It doesn’t matter if it’s a class, an XML file, or even a resource ID ( It just works.

  • ⌥ + F7 – Find usages. Similar to other shortcuts, this works on classes and XML files.

  • ⌘ + N – Generate code. Getters and setters, override methods, etc.

  • Control + T – Refactor menu. Extract methods & classes, generate interfaces, etc.

  • ⌥ + Enter – Quick fixes. This may be one of my most frequently used shortcuts. Implement methods for a superclass or interface, generate a layout file on-the-fly, import a package.

  • Ctrl + ⌥ + I – Auto-indent. Everyone loves pretty code.

  • Ctrl + ⌥ + O – Clean up imports. Again, everyone loves pretty code.

Read More

send push notification from server to android device using php

For sending the push notification from server to android device using php than you can use below code function.
ANDROID_APIKEY : this is api key of google project. you can find this key from google api console as server must use here server key not android key.

You can set your custom parameter also as per your app requirement.

By providing multiple device token you can send push notification parallely to all devices.

Read More

Text Shadows in Android

Often tools like Photoshop are used to create graphic elements which are actually text with various effects applied to them, and an well used effect in such elements is the use of shadows. Android supports text shadows, and in this article we’ll explore a number of ways that we can use the built in shadows as it is much more efficient to use Text View than it is to include lots of bitmap elements for our text; it also makes designing for multiple screens much easier, as well, because the Android layout manager can scale Text View elements much easier than the bitmaps in Image View objects.


In the above XML layout code, the textview1 is given with Shadow effect in the layout. below are the configuration items are

  • android:shadowDx – specifies the X-axis offset of shadow. You can give -/+ values, where -Dx draws a shadow on the left of text and +Dx on the right
  • android:shadowDy – it specifies the Y-axis offset of shadow. -Dy specifies a shadow above the text and +Dy specifies below the text.
  • android:shadowRadius – specifies how much the shadow should be blurred at the edges. Provide a small value if shadow needs to be prominent.
  • android:shadowColor – specifies the shadow color



Read More