Wrox Programmer Forums
BOOK: Professional Android 2 Application Development
This is the forum to discuss the Wrox book Professional Android 2 Application Development, 2nd Edition by Reto Meier; ISBN: 978-0-470-56552-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android 2 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 17th, 2011, 03:39 PM
Registered User
Join Date: Feb 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Newbie (very newbie!) question about com.paad.*

I am new to Java and very very new to Android development. I see references to com.paad.* everywhere in this book. What does this mean? Is this just a namespace? If I have my own domain name say JamiesDomain.com, should I be using com.JamiesDomain.* ??

Apologies for the noob-ness of these questions, but it's been driving me nuts, and I have not found an answer through searching.

Old May 23rd, 2013, 05:23 PM
Registered User
Join Date: May 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Newbie here too. Curious about the same!
Old June 5th, 2013, 06:46 AM
Registered User
Join Date: May 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Package Name is the package namespace for your app (following the same rules as packages in the Java programming language). Your package name must be unique across all packages installed on the Android system. For this reason, it's generally best if you use a name that begins with the reverse domain name of your organization or publisher entity. For this project, you can use something like "com.example.myfirstapp." However, you cannot publish your app on Google Play using the "com.example" namespace.

Reference: http://developer.android.com/trainin...g-project.html

I believe you can name it however you want, but if your company has a website JamiesDomain.com I think, as per this paragraph, that you can name it com.JamiesDomain.yourappname
Old June 5th, 2013, 06:52 AM
Registered User
Join Date: May 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default More info

I hope this also helps!

Naming a Package

With programmers worldwide writing classes and interfaces using the Java programming language, it is likely that many programmers will use the same name for different types. In fact, the previous example does just that: It defines a Rectangle class when there is already a Rectangle class in the java.awt package. Still, the compiler allows both classes to have the same name if they are in different packages. The fully qualified name of each Rectangle class includes the package name. That is, the fully qualified name of the Rectangle class in the graphics package is graphics.Rectangle, and the fully qualified name of the Rectangle class in the java.awt package is java.awt.Rectangle.

This works well unless two independent programmers use the same name for their packages. What prevents this problem? Convention.
Naming Conventions

Package names are written in all lower case to avoid conflict with the names of classes or interfaces.

Companies use their reversed Internet domain name to begin their package names—for example, com.example.mypackage for a package named mypackage created by a programmer at example.com.

Name collisions that occur within a single company need to be handled by convention within that company, perhaps by including the region or the project name after the company name (for example, com.example.region.mypackage).

Packages in the Java language itself begin with java. or javax.

In some cases, the internet domain name may not be a valid package name. This can occur if the domain name contains a hyphen or other special character, if the package name begins with a digit or other character that is illegal to use as the beginning of a Java name, or if the package name contains a reserved Java keyword, such as "int". In this event, the suggested convention is to add an underscore.

For example:
Legalizing Package Names Domain Name Package Name Prefix
hyphenated-name.example.org --> org.example.hyphenated_name
example.int --> int_.example
123name.example.com --> com.example._123name

Reference: http://docs.oracle.com/javase/tutori...amingpkgs.html

Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie Question sionfx VS.NET 2002/2003 0 November 16th, 2006 03:32 PM
newbie question pbb Ajax 0 September 26th, 2006 05:47 AM
Newbie question savoym JSP Basics 1 August 16th, 2006 03:15 AM
C# Newbie Question jazzcatone ASP.NET 2.0 Basics 1 May 25th, 2006 10:18 PM
Newbie question Beginner VB.NET 2002/2003 Basics 2 November 9th, 2003 07:58 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.