for this time I will quote reading android logcat in the studio, it’s useful logcat really does make reading errors when deploying projects android and may Logcat very important and you should be able to master this to minimize the error on your android project. Perhaps immediately wrote ya.
Sample case :
It is important for young developers to know Logcat early, as already explained above that this logcat will tell us what is done by our application, among others:
- Closed Force Error.
These are some young developer confusion of what to do in case of Force closed error.
- Data integration using the API.
Retrofit sort HTTP Client Library, Volleyball, etc. already includes its own logs on request and response activities. So stay just read request, response, along with the data post and header.
- Checking the data in and out of our application.
Simple example is the push notifications, when friends work using push notifications and want to know what data is transmitted to the application server push notifications us, simply check just to Logcat. Services like OneSignal, Pushbots, etc. typically include features for ease developer log in using their services.
Now I wish to discuss here is, how to read the error in Logcat. Because this is important, because with the Force Closed Error Our application will not be the right target could even be useless. See sample below.
Things to note are:
- Exception Type
This type usually is under the PID. In the above example the type is ` ActivityNotFoundException `. Activity not found. Not found where? See point number 2.
- Exception Message
note of the message given to the developer, ” Unable to find …: Have you declared in your AndroidManifest this activity? “Well this is very clear, what android wanted and what we should do.
- File influential
Note the blue file, this is the link to the file. Select the top to be executed. After the click, check that row which activity that has not been declared in AndroidManifest.xml
The example above is a simple example of the most basic, there are many exceptions-an exception that might occur. Exceptionnya Whatever, the point is three things above. If still not found a way out, try to copy-paste message exception to Google . Hopefully outside the forum can help.
If you check the error in the default DDMS tool android SDK / Tools, keep in mind, when the application is running, log nampil it was not just an error, is not thought that there is a message in the log mean error.
Text green: about tips and information,
blue text: diselect section, usually filled to-do-list by the developer,
the text color orange: this as a warning, it could be a potential problem (but there is currently a problem)
red text: this error, and should analyze the problem let me not cause interference in applications.
And when it appears in red text in the logcat, for example:
02-12 17:50:21.541: E/com.wd.radiodakwahislam.controller.StreamingMediaPlayer(10294): Error updating to newly loaded content.
02-12 17:50:21.541: E/com.wd.radiodakwahislam.controller.StreamingMediaPlayer(10294): java.lang.NullPointerException
02-12 17:50:21.541: E/com.wd.radiodakwahislam.controller.StreamingMediaPlayer(10294): at com.wd.radiodakwahislam.controller.StreamingMediaPlayer.transferBufferToMediaPlayer(StreamingMediaPlayer.java:285)
It is apparent that there is an inscription: “…
means that the error occurred at line 285 in
class StreamingMediaPlayer.java. So, focus to class, and look at line 285 there is a mistake or not (see from his Eclipse editor).
Well, if confused, at the beginning of the red text in the logcat, copy its text (with select its error text in the logcat, continue to press ctrl + c), and remove dates and names of his class so that most copy only the text of the error A:
error updating to newly loaded content.
Copy and paste into google search in the internet browser on the PC (when it is necessary to add keyword: Android at the end), continue to enter and look at the result of google , usually result big 3 contains links stackoverflow , click on one of them and find what the cause of answers in stackoverflow.
Rules that contain:
- When reporting bugs , please include the devices what to wear and its android OS versions.
- If there are bugs / problems UI please include a screenshot, if a functional problem please include logcatnya (by downloading the following tools) / ** I include the download link that contains a zip DDMS and Android SDK tools and their way of life ** short doc /
- Sebaikny use filtering when running logcat on DDMS, not all of the processes listed in logcat, in order to facilitate searching problem
- DDMS can filter logcat application only, so not all of the log of the process in the device recorded, how to enter the name of the project on the column filter . Name of the project in accordance I specified when I upload progress (the name of the project can be found in the file manifest.xml)
- Why is it important for the developers to know that? For a more easily determine the error
Do not think when the application path in the device developer then be generalized if the application in the device ALL road users. In fact what happens in the office where I work, the error was actually very likely to occur in view of the friends put on Android devices of different brands and screen sizes and OS versions.
So there are conditionals applied dicode: IF (SDK version <10) use codingan A, IF (SDK version> 14) use codingan B, etc.
- Therefore, it is important to have public testing before release to GooglePlay .
And a great media to do public testing free yes social networks facebook etc.
- Different screen sizes are different again UInya, so when I collaborated with the designer UI there are some rules that must be adhered together to be applied in layout and include a screen size of the low, mid, high, (phone dr small size until large) extra (7 “tablets or HD) and double extra (10 “tablets or mouth full HD). For guidelines for the Android UI designer, able to comply with the principles of its design in here and there in full here for every part of the design of his.
I think maybe you should go to this site though more clearly again https://developer.android.com/studio/debug/am-logcat?hl=id
on the site full dijelasin about debugging and read the logcat. maybe it was just hell from me, thanks