Pacage name

Put your problem here if it does not fit any of the other categories.

Pacage name

Postby la3bna » Wed Mar 30, 2011 6:00 am

Hi This is probably a really 00b question but.

Is It possible to name my package what I want or are there some rules about how to name them?

Reason for asking is that I have some code built off the hello tab view tutorial on android.com and when I change the package name (on new project) It crashes.

Hoping for answers...
la3bna
Experienced Developer
Experienced Developer
 
Posts: 72
Joined: Wed Mar 30, 2011 5:49 am
Location: Stavern, Norway

Top

Re: Pacage name

Postby raj_J2ME » Wed Mar 30, 2011 7:47 am

Welcome to the Android Forums .. :)

Well AFAIK, there are some rules about the package naming conventions in every language, in android some of the most important rules can be read here with the details.
http://blog.javia.org/android-package-name/

Are you getting some error when your app went to crashed?
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Re: Pacage name

Postby la3bna » Wed Mar 30, 2011 7:55 am

Well the standard process (my package) has stopped unexpectedly. Pleas try again.

Might be that I have some other issue that Im not aware of also..

But Im trying at least
la3bna
Experienced Developer
Experienced Developer
 
Posts: 72
Joined: Wed Mar 30, 2011 5:49 am
Location: Stavern, Norway

Re: Pacage name

Postby raj_J2ME » Wed Mar 30, 2011 8:06 am

la3bna wrote:Well the standard process (my package) has stopped unexpectedly. Pleas try again.

Might be that I have some other issue that Im not aware of also..

But Im trying at least

Name the both of the packages in order, with the details that which was working and which was not?
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Re: Pacage name

Postby la3bna » Wed Mar 30, 2011 10:39 am

Not quite sure I know what you mean.

My package is named no.markel.NSF

And when I try to start the application this is whats stopping. Dont have the project here @ work
la3bna
Experienced Developer
Experienced Developer
 
Posts: 72
Joined: Wed Mar 30, 2011 5:49 am
Location: Stavern, Norway

Re: Pacage name

Postby raj_J2ME » Wed Mar 30, 2011 11:39 am

I am asking to list the package name when the app was running and the current package name when the app is getting crashed.
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Top

Re: Pacage name

Postby la3bna » Wed Mar 30, 2011 7:40 pm

This is the output from the console in Eclipse

Code: Select all
[2011-03-30 20:33:12 - Hello Tab] Starting activity com.example.hellotabview.HelloTabWidget on device emulator-5554
[2011-03-30 20:33:17 - Hello Tab] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.hellotabview/.HelloTabWidget }
la3bna
Experienced Developer
Experienced Developer
 
Posts: 72
Joined: Wed Mar 30, 2011 5:49 am
Location: Stavern, Norway

Re: Pacage name

Postby la3bna » Wed Mar 30, 2011 8:09 pm

I kinda solved it my self.


In the AndroidManifest.xml
Code: Select all

           android:name=".NSFTabWidget"



Using the same name as my "main" .java file helps alot ;)

Thanks for helping !!
la3bna
Experienced Developer
Experienced Developer
 
Posts: 72
Joined: Wed Mar 30, 2011 5:49 am
Location: Stavern, Norway

Re: Pacage name

Postby raj_J2ME » Thu Mar 31, 2011 7:17 am

I will request you to share the solution in a bit details so that others can also be benefited in future.
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Re: Pacage name

Postby la3bna » Thu Mar 31, 2011 8:25 am

Ok here goes..

The app didnt start because I had named the main activity wrong in the Manifest.xml

Here is how it was:
Code: Select all
<application android:icon="@drawable/icon"
       android:label="@string/app_name"
       android:allowClearUserData="true"
       android:debuggable="true">
        <activity android:name=".NSF"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>


My package name is: no.markel.NSF
Main activity is named: NSFTabWidget.java (from the tab tutorial on adroid.com)

Looking at what I called the activity here is what it is supposed to be:

Code: Select all
<application android:icon="@drawable/icon"
       android:label="@string/app_name"
       android:allowClearUserData="true"
       android:debuggable="true">
        <activity android:name=".NSFTabWidget"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
la3bna
Experienced Developer
Experienced Developer
 
Posts: 72
Joined: Wed Mar 30, 2011 5:49 am
Location: Stavern, Norway

Re: Pacage name

Postby raj_J2ME » Thu Mar 31, 2011 8:45 am

That means the issue wasn't due to the package...and it was due to the wrong name of the activity inside the manifest.
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Re: Pacage name

Postby la3bna » Thu Mar 31, 2011 9:21 am

Yupp
Like I said Im a n00b (lol)

But its nice to figure it out by my self..
la3bna
Experienced Developer
Experienced Developer
 
Posts: 72
Joined: Wed Mar 30, 2011 5:49 am
Location: Stavern, Norway

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 8 guests