Android :: Private Fields Naming Guidelines

Jan 25, 2010

Here http://source.android.com/submit-patches/code-style-guide#shortmethods it is stated that :

"Field Names
* Non-public, non-static field names start with m.
* Static field names start with s.
* Other fields start with a lower case letter.
* Public static final fields (constants) are ALL_CAPS_WITH_UNDERSCORES.

also states that : "The rules below are not guidelines or recommendations, but strict rules. You may not disregard the rules we list below except as approved on a need-to-use basis." I don't like the "m" convention before private or package fields in a class... I really find this uninspired. I mean, if we try to apply good designs, the low coupling of the classes implies having few public fields. actually, in my programs I usually have no public fields, even when I need some I use getters and seters. so, why should I be forced to have almost all my fields in the program with an "m" in front of them? wouldn't be easier to have the few public fields, if there are any, with some "g" in front or something? or just use setters and geters as beans suggest? this really makes my code harder to read. also, following these guidelines, local temp variables used in the methods have no restriction so they could easily be mistaken for public global fields (also without restriction). this also I find to be wrong, as it is a probable source of mistakes. I understand to have a way of differentiating from fields, but private/protected member fields are the most used in an application, they shouldn't be less "readable". what do you think? should I follow the guidelines?

Android :: Private fields naming guidelines


Android :: Can't Access Package Private Fields In Android.widget Package?

Oct 7, 2010

I'm attempting to override an Android View class to tweak the functionality just slightly. But I need to modify a field that does not have a setter method. I've placed the subclass in a package called android.widget. Why can't I access any of the package-private member fields? I notice that the compiler says they "cannot be resolved," rather than not being accessible. Does this have something to do with how Android.jar is built?

View 2 Replies View Related

Android :: Suggestions For Phone Project Guidelines

May 19, 2010

Im trying to prepare a set of guidelines and project template for my future Android projects. Im already implementing the basic MVC architecture modularity. Im trying to have add more advanced level of design to my Android projects to make my development easier and maintainable. For example can someone suggest me a way to make Intent calls to Activity without explicitly mentioning the class while creating the Intent. Im trying to loose couple the intent calls and hopefully use AndroidManifest to assign action to an activity which then can be called globally within the application.Any other type of suggestions are welcome. Also please suggest any kind of coding conventions that you might be using yourself.

View 1 Replies View Related

Android : Guidelines For Start Up / Error With WiFi

Aug 22, 2010

Today I got my first android phone. It is the Samsung Galaxy Spica.I don' t know anything about android phones so I need someone to show the first steps and explain to me the specifications of this operating system.I have a problem with my WiFi. The phone finds my network, I give the password but it says "Connection failed". Can anyone help me?

View 7 Replies View Related

Android :: Where Can I Find Information About 2.x Icon Design Guidelines?

Feb 10, 2010

Assuming that old Icon design guidelines are not valid anymore, where can we find information about the guidelines to follow to design "new-styled" 2.X launcher icons?Should applications provide icons for both icon styles if they work for both versions?

View 1 Replies View Related

Android :: Good Guidelines For Developing Ecommerce Application

Jun 9, 2010

I'm making an ecommerce application on Android and, as it is my first serious project, I'm trying to figure out beforehand the best approach to do this.The application talks to a web service (magento api, meaning soap or xml rpc unfortunately) and gets all the content on the phone (product categories, product details, user credentials etc.). I think it should do lazy loading or something like that.

So, I was thinking to keep the user credentials in a custom Object which will be kept in a SharedPreferences so that every Activity cand easily access it. I'll use a couple of ListViews to show the content and AsyncTask to fetch the data needed. Should I keep all the data in memory in objects or should I use some sort of cache or a local database? Also, I'm planning to use a HashMap with SoftReferences to hold the bitmaps I am downloading. But wouldn't this eat a lot of memory?How cand all the activities have access to all these objects (ecommerce basket etc.)? I'm thinking of passing them using Intents but this doesn't seem right to me. Can SharedPreferences be used for a lot of objects and are there any concurrency issues?

Any pointers would be really appreciated. What are some good guidelines? What classes should I look into? Do you know of any resources on the Internet for me to check out?

View 2 Replies View Related

Android :: Inconsistent Naming For SDK 2.1

Apr 6, 2010

I find that the name of google maps api directory in 2.1 platform is wrong google_apis-3-r03 while all others google_apis-4_r02 i.e - prefixed instead of _ used for release.

View 2 Replies View Related

Android :: Java Self Naming?

Apr 5, 2010

I am about to start developing an Android application and had a question if in Java there self naming. For instance say I had a variable named dog that held the value of scruffy. Could I then create a variable named scruffy from that variable. In PHP it would be $$dog. That would make a variable with the name scruffy.

View 1 Replies View Related

Android :: Naming Conventions And SDK

Jun 9, 2010

Is there a publicly available document explaining the naming conventions followed in the Android SDK?

View 1 Replies View Related

Motorola Droid : Guidelines Using SetCPU As Far As Profiles - Performance And Battery Life?

Jun 25, 2010

I was just hoping for some guidelines when using SetCPU as far as profiles, performance and battery life? I know it varies by kernel and right now I am using Chevy's uLV 1Ghz kernel.

View 1 Replies View Related

Android :: Package Naming / Renaming?

Oct 21, 2009

I am trying to do an update to an app that was released under 1.0 about a year ago. When it was released, I used the package naming convention: "com.android.myApp". At the time, I thought this was the correct naming convention. In retrospect, this is not the case. The AndroidMarket does not accept new apps with "com.android" package names, so I am assuming the way I did it is frowned upon/disallowed. So my question is two-fold. #1: What is a correct method for selecting package names? I have started using a convention "com.myAppClass.appname". Where "myAppClass" is a arbitrary name that applies to a group of related apps and "appname" is the specific application (e.g. "com.mycategory.appDemo" and "com.mycategory.appFull"). Is this right? #2: What do I do about the app already released as a "com.android" package? My assumption is to recreate it using the above convention. What will the effect be on users who want to upgrade the application through the market or will the market even accept an upgrade version using a different package name?

View 3 Replies View Related

Android :: Naming ID In Phone Applications

Nov 24, 2010

If you are developing Android application, you will encounter such a id naming in xml files of view and layouts :

<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/new_game"
android:icon="@drawable/ic_new_game"
android:title="@string/new_game" />
<item android:id="@+id/quit"
android:icon="@drawable/ic_quit"
android:title="@string/quit" />
</menu>

and I am really wondering why such naming is applied to ids. It is because of Linux? What kinda meaning this naming --@+id/...--has? When I am looking at android:icon attribute I can interpret that it means ic_new_game is located under drawable folder and @ means "located at" or I just assume that. But naming id attributes are kinda different because they also have + sign. Can somebody help me understand this convention?

View 1 Replies View Related

Android :: Naming A Folder That You Have Created On Your Desktop

Jul 5, 2010

I don't see an option for naming a folder that you have created on your desktop. You can do this on blackberry.

View 4 Replies View Related

Android :: Naming Phone - Natural Voice Protocol

Dec 21, 2009

I was wondering if there is an app that allows you to name your phone. For example lets say i named my Droid. Optimus Prime And then i could use voice protocol after saying my phone's name For example Optimus Prime please text autobots (contact group), "Autobots Transform and roll out!" After saying its name the phone would automatically know that Autobots is a contact group and that the message i want texted is "Autobots Assemble!" Is there an app like this already? If there isn't it would be a great idea for one.

View 2 Replies View Related

Android :: UI Design Guidelines For Android Tablets

Jun 22, 2010

Are there any UI design guidelines for the upcoming Android tablets? Looks like the Archos 7 will be available sometime this month. My question is not about supporting the screen size but more about providing a more appealing UI interface for a bigger screen device.

View 2 Replies View Related

Android :: Meaning Of Variation In Phone Attribute Naming Styles?

Nov 18, 2010

It looks like the naming style for android attributes varies between underscore and camel case. Does the variation mean anything, or is it arbitrary? edit: examples would be layout_width and columnWidth.

View 1 Replies View Related

Android :: Some Rules Of Thumb For Naming Classes That Extend Activity Class?

Nov 5, 2010

I go back and forth about how to name activity classes.Activity seems to imply a verb, like EditContact, for example.But that seems more like what one would call the Intent that triggers EditContact.Should the activity be named ContactEditor instead?

View 2 Replies View Related

Motorola Droid :: Naming Map Locations

Feb 20, 2010

I have been a voyeur on this forum for about a month but tbis is my first post. Is there any way to name a location in Google Maps? I cannot remember all the addresses that show up in the map search. For example, I would like to rename 1400 Pennsylvania Ave. as The President. Can this be done?

View 5 Replies View Related

HTC Hero :: Phone Naming And Bluetooth Recognition

Nov 16, 2009

Can anyone tell me how I go about naming my phone and I have been trying. this morning (No work today) to find my Hero on my N95 via Blue tooth but the N95 can not locate the Hero, only 2 LGs that are next door.

View 12 Replies View Related

Motorola Milestone :: WiFi - Naming Phone?

Jan 29, 2010

Try as I might, I can't find a way to give my Milestone a name on WiFi. My employer are being funny about adding a device that is unnamed, but I can't see where to do it.

View 3 Replies View Related

LG Eve : How Does Album Thumb Naming Convention Work?

Jan 6, 2010

Can anyone help with album covers? I have one album that shows up with its cover in the default music player. I assume that is because it is included in one of the tags information, I added covers to other albums tag info using windows media player and the advanced tagging option (method found in other forum for other lg phone) but the covers still don't show up when I put the albums back on my phone. Does anyone know which tag the music player is reading? There is also a folder (albumthumbs) that showed up on my sd card once I copied the album thats artwork does work to my phone, and in it is a file without an extension (this is obviously the cover for the one working album). Can I add jpgs to that folder or something and how does the album thumb naming convention work?

View 5 Replies View Related

General :: LG Nexus 4 - How To Change Naming Format

Aug 24, 2013

I am using LG nexus 4, I would like to change the format of file name of the image taken by my camera, How could I change the settings.Where should I look into.

View 1 Replies View Related

Sprint HTC Hero :: Folders - Adding - Naming - Renaming?

Nov 8, 2009

When adding a new folder, it simply states: "Folder" Is it possible to give a folder a name? Modify the name of a folder? Re-name the folder? Once items are dragged into folders, can they be taken out? Dragged out? Deleted while in the folder? Seems I have to delete the entire folder and start over.

View 2 Replies View Related

HTC Desire HD :: Phone Stuck At Naming Phones Rant

Sep 15, 2010

Are they that lazy that they cant even give any of there new phones a real name. they just take the name of an older phone and just add the letters "HD" or "Z" to it. and the Desire HD and Z dont even resemble the original Desire is any way at all. also same thing with the Mytouch HD, wich is just a Mytouch 3G slide with out a keyboard. speaking of the Mytouch 3G slide that is another crappy named phone, why couldnt it have been called just the Mytouch Slide instead? did they really need to have "3G" in the title when 99.9 percent of all other android phones have 3G support? and now the Evo 4G and Epic 4G, are they going to have to make EVERY single upcoming 4G android phone have "4G" in the name too? and another thing that pisses me off is the "DROID" name. what idiot at verizon decided it would be a good idea to just rename all of there major androids to have the word Droid in front of it? why couldnt the Droid Incredible and the Droid Eris just be called the HTC Incredible and Eris just like they were originally planned to? and HTC did not even make the original "Droid" phone, so HTC shouldnt even be naming there phone Droid in the first place, ONLY motorola should. what is next? are they going to release another phone for verizon and call it the "HTC DROID Incredible HD"?

View 14 Replies View Related

Android :: Android Id Naming Convention - Lower Case With Underscore Vs Camel

Dec 2, 2009

I'm currently programming an application for the Android. Now what I found out is that you cannot place resource objects, say, an image in the drawable folder and name it like "myTestImage.jpg". This will give you a compiler error since camel case syntax is not allowed, so you'd have to rename it like "my_test_image.jpg".
But what about ids you define in the XML file. Say you have the following definition

<TextView android:id="@+id/myTextViewFirstname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Firstname" />

This is a valid definition, compiles and works just fine on my Android emulator although - as you see - I'm specifying the id in camel case syntax. Now, the Android samples always use lower case and underscore. Is this just a naming convention to use lower case with underscore for the id's or may it cause problems on the real device?

View 3 Replies View Related

Android :: How To Use OverlayItem's Fields?

Aug 3, 2009

I would like to how to use OverlayItem's fields (Title and snippet) 'cause they are never displayed on the map?

View 2 Replies View Related

Android :: Contact Custom Fields

Jun 9, 2010

Alright, I'm a little new to the Android SDK, so forgive me if my question doesn't make sense or is very trivial. I'd like to add a custom field for contacts, that contains the contacts username on a website I'm doing this app for. And, with this custom field, I'd like to have the ability to click it (like "Send message" or "Call mobile") so that I can go to a specif Activity in my application, with a TextView set with the username that I just clicked on.Sorry if that is a bit confusing, if you need anything else let me know!

View 1 Replies View Related

Android :: Accessing Fields Across Package

Jul 6, 2010

How do I make fields accessible across a package? Currently, even if they are declared public i'm not able to access the fields from another class in the same package.

View 2 Replies View Related

Android :: Prompt Box With Several Fields And Image?

Jun 29, 2010

I am new to writing Android Applications, and I need to be able to implement the following functionality. When a user clicks a specific button, I want a customized "prompt" box to appear, containing several fields (a textfield, a password field, and a checkbox field). I would also be nice if I could add an image inside this box. How would I go about implementing this sort of functionality?

View 2 Replies View Related

Android : Need To Create A Private Jar

Apr 2, 2009

I'm currently developing my own Android widgets. To help me in future projects and speed up my developments, I've been trying to create a private jar that contains all those widgets (that extend from Android classes such as View or ViewGroup). To do that, I created a project and included all files (.Java and resources) in this project. I exported this as a jar file. To test this jar file I created a new project and tried to include my widgets using an XML layout. Unfortunately, it seems that the system does not "see" my resources. Looking at the Android source code, I noticed that android.jar contains its own resources so I assume this is possible.

I'm sure I've done something wrong...but what? What is the problem? And how to solve it?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved