Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3981706
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:26:33+00:00 2026-05-20T05:26:33+00:00

I have been creating Intents using putExtra() for quite a while now and just

  • 0

I have been creating Intents using putExtra() for quite a while now and just read in the Android documentation that I should be prefixing the ‘name’ with the package name. So, instead of ‘putExtra( “ButtonText”, “Ok”)’ it should be more like ‘putExtra( “com.mycompany.myapplication.ButtonText”, “Ok” ).

Is this really necessary? (seems to be OK without it).

If it is necessary what is the advantage?

Also, is the package name the callers or the one being called? If it is the callers the ‘called Activity’ has to know about the callers name which wouldn’t be very generic.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:26:33+00:00Added an answer on May 20, 2026 at 5:26 am

    Is this really necessary? (seems to be OK without it).

    No, it isn’t necessary for a completely stand-alone app but may be considered to be good practice anyway.

    It is more important in apps which are publicly available so they can interact but maintain some way of uniquely identifying themselves and the data they’re exchanging. As for which package name is used will depend on the context.

    To give an abstract example…

    Company A produces an app which can provide some sort of data processing which apps produced by Company B and Company C can use. The ‘action’ for the intent will be named relevant to Company A but the data passed into it by the two ‘client’ apps will be named relevant to the client apps companies. Example…

    AppA’s docs…

    To request data processing use:
    com.companyA.intent.action.PROCESS_DATA
    
    Pass data with the above intent as an extra named:
    <your package name>.SOME_DATA
    

    Now when the relevant component of AppA is called with the above, it will check that there’s an ‘extra’ with a name which ends with .SOME_DATA but it will also be able to maintain that data separately from other data provided by other apps due to the unique prefix. So…

    Company B code

    Intent i = new Intent(com.companyA.intent.action.PROCESS_DATA);
    i.putExtra(com.companyB.SomeApp.SOME_DATA, data);
    

    Company C code

    Intent i = new Intent(com.companyA.intent.action.PROCESS_DATA);
    i.putExtra(com.companyC.SomeOtherApp.SOME_DATA, data);
    

    OK, possibly not one of my better examples but what it comes down to is it’s important to see how the Android environment is very much about different application components being able to use each other, pass data and for the source of that data to be uniquely identifiable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have been using CruiseControl for quite a while with NUnit and NAnt. For
I have been creating Unit tests like crazy and find that I'm often having
I have been tasked with creating a program that will generate an amortization schedule.
I have been in both situations: Creating too many custom Exceptions Using too many
I have been creating and using a page on the development environment for awhile,
I have been using SQL Server 2008 for about a year now and my
I'm quite new to objective c but have been programming for a while. I
I have been creating a website with Ruby on Rails, and will be hosting
I have been tasked with creating a program what will create take files in
I have been tasked with creating a reusable process for our Finance Dept to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.