HTC Sync is not compatible with Windows 8 yet. This include not being able to debug and develop on your HTC Desire HD mobil and possible most of HTC mobiles. HTC One, Sensation, Magic and more. Eventhough you have enabled USB debugging. It’s the USB driver which is missing (or not working correctly) for Windows 8. Google
Tag: Android
Android Calculate Time Between Two
Use a Date object: Date interestingDate = new Date(); You can find the different in milliseconds between the actual current date and interestingDate by doing: long time = (new Date()).getTime() – interestingDate.getTime()
Android Follow Test Method Naming Conventions
When naming test methods, you can use an underscore to separate what is being tested from the specific case being tested. This style makes it easier to see exactly what cases are being tested. For example: testMethod_specificCase1 testMethod_specificCase2 void testIsDistinguishable_protanopia() { ColorMatcher colorMatcher = new ColorMatcher(PROTANOPIA) assertFalse(colorMatcher.isDistinguishable(Color.RED, Color.BLACK)) assertTrue(colorMatcher.isDistinguishable(Color.X, Color.Y)) } Source: http://source.android.com/source/code-style.html
Android Be Consistent
Our parting thought: BE CONSISTENT. If you’re editing code, take a few minutes to look at the code around you and determine its style. If they use spaces around their if clauses, you should too. If their comments have little boxes of stars around them, make your comments have little boxes of stars around them
Android Log Sparingly
While logging is necessary it has a significantly negative impact on performance and quickly loses its usefulness if it’s not kept reasonably terse. The logging facilities provides five different levels of logging. Below are the different levels and when and how they should be used. ERROR: This level of logging should be used when something
Eclipse Java TODO Comments
Use TODO comments for code that is temporary, a short-term solution, or good-enough but not perfect. TODOs should include the string TODO in all caps, followed by a colon: // TODO: Remove this code after the UrlTable2 has been checked in. and // TODO: Change this to use a flag instead of a constant. If
Android Treat Acronyms as Words
Treat acronyms and abbreviations as words in naming variables, methods, and classes. The names are much more readable: Good Bad XmlHttpRequest XMLHTTPRequest getCustomerId getCustomerID class Html class HTML String url String URL long id long ID Both the JDK and the Android code bases are very inconsistent with regards to acronyms, therefore, it is virtually
Android Use Standard Java Annotations
Annotations should precede other modifiers for the same language element. Simple marker annotations (e.g. @Override) can be listed on the same line with the language element. If there are multiple annotations, or parameterized annotations, they should each be listed one-per-line in alphabetical order.< Android standard practices for the three predefined annotations in Java are: @Deprecated:
Android Limit Line Length
Each line of text in your code should be at most 100 characters long. There has been lots of discussion about this rule and the decision remains that 100 characters is the maximum. Exception: if a comment line contains an example command or a literal URL longer than 100 characters, that line may be longer
Android Use Standard Brace Style
Braces do not go on their own line; they go on the same line as the code before them. So: class MyClass { int func() { if (something) { // … } else if (somethingElse) { // … } else { // … } } } We require braces around the statements for a conditional.