Last Updated: April 17, 2016

Tips & tricks android developer should know - part 2

Description: In the post we'll continue the legacy of  Part 1 :-) . Below are some tips and tricks which would come much handy and useful during our app development cycle.

So lets get started :-)




Note : If you have missed part 1. Please refer here

1. Capture or record screen without any external app.

Often we require to take snapshot of the app's screen or even record a video to show some features to colleagues or QA or Client . It comes handy very often.

Step 1: Simply connect your device. Open Android Monitor from android studio you'll see as fig.1.
http://code2concept.blogspot.in/
fig.1
Step 2: Now, you can open your app and click on the camera icon from android monitor located  to the extreme top-left corner to capture any screen you want. Bingo !!!

For video: Click video icon below the camera icon. Enter the resolution with multiples of 16x. fig.2. That's it. It'll start recording your action's on the app.

http://code2concept.blogspot.in/
fig.2



2. How to find layout boundaries?

Layout boundaries are very useful when we develop our UI components. It gives a real sense to layout, thereby letting us to study arrangement of different widgets in the layout.

Step 1: Open Settings --> Developer Options --> Show layout boundaries. From drawing section

https://www.linkedin.com/in/nitesh-tiwari-b5032a74
fig.3.LinkedIn app

fig.3. A Simple analysis for pencil icon. (without opening our layout)

1. Edit pencil icon has some padding to itself. 
2. Its align to top-right corner to its parent layout.

Really awesome.





3. Simplest way to decode obfuscated code?

As we know, code are obfuscated when we build our apk with proguard enabled. We often come in contact with obfuscated code in our app while debugging the stacktrace of the crashes.

So decoding is very much needed to study the stackstrace. Android build's a file called as "mapping.txt" which serves as the key ingredient to decode, in combination of "retrace".

In Windows

Step 1: Go to  (android-studio-install-dir-path)\tools\proguard\bin  open "proguardgui.bat"  fig.4

fig.4
Step 2: Click on "ReTrace" fig.5. and upload your "mapping.txt" file from app/build/outputs/mapping/.../mapping.txt   and the obfuscated code file (e.g: crash.txt). You can also simply paste the stackstrace in the box provided.

Note: If you do not find mapping.txt. You have to generate a signed apk with proguard enabled("minifyenabled true" within the app's build.gralde).

http://code2concept.blogspot.in/
fig.5
You can also use command line code to do that.

\tool\proguard\bin> retrace.bat -verbose   (path_to_mapping.txt)\mapping.txt  (path_to_stacktrace)\crash.txt

Thus just applying some simple tricks and tips really make a difference in the speed of development. #code2concept

8 comments :

  1. You know I am not actually a Android developer, but my friend is a developer. So, I'll show him this post. Thank you! I prefer to use this great free cell phone tracker app https://www.hoverwatch.com/ to spy other people.

    ReplyDelete
    Replies
    1. Thanks Sandra. Please spread the word. Will be really helpful for developer community.

      Delete
  2. Those guidelines additionally worked to become a good way to
    recognize that other people online have the identical fervor like mine
    to grasp great deal more around this condition.


    Android Training in Chennai


    Android Training in Bangalore

    ReplyDelete
  3. Nice tips. I've recommended this article to my friend who is Android developer. It's very useful when someone recommend you something useful for you. Several days ago I had to write an essay but I didn't know where to start from. So, I followed the advice of my fridn and used an essay writing service https://uwritemyessay.com/.

    ReplyDelete
    Replies
    1. Thanks Amy. Will keep posting new stuffs.

      Delete
  4. If you have a business that needs to quickly augment the internal development team with highly specialized talent or complete any crucial development task without much delay, then the first thing to determine is whether your in-house programmers or designers are able to take up the project without any extra help and devote full time to it.Edknt Media

    ReplyDelete
  5. This blog very useful for me to learn and understand easily.Thanks for sharing the useful information .This is really helpful for me.
    Java Training in Chennai

    Selenium Training in Chennai
    Software Testing Training in Chennai

    ReplyDelete
  6. Decide first, why you desire a mobile phone tracker. Learn about SMS Tracker: How to track on SMS messages
    on phonetracking.net.

    ReplyDelete

Your comments are valuable for us !!!