What is the package in android? - android

I have uploaded my first application to google playstore
as you see in this image in manifest in package it says auc.visorimagenes.ssssss
in the left part you could see my structure code where it is as
auc.visorimagenes.
in playstore
you see it:
but What it says auc.visorimagenes
if in my manifest I had set auc.visorimagenes.sssss
I want to up a new app with same code (only changing some resources) this is would be a new app not an update.
then I must to change auc.visorimagenes.sssss ???

Contains information about a Java package. This includes implementation and specification versions. Typically this information is retrieved from the manifest.
Packages are managed by class loaders. All classes loaded by the same loader from the same package share a Package instance.
Hope this helps!

Could you try and change the android:name attribute of your application entry in the manifest as follows and see if it helps?
<application
....
android:name=".App" (or android:name=".Application.App")
/>
This will ensure that the app uses the same package name as the one declared in the manifest.

The package in android is the name of the application that makes it unique from any other android apps, therefore allow the production of multiple apps with the same product name.

Related

Android safety question using android exported

I'm not an android dev. I used capacitor to convert a web app into an android app. The new sdk 31 changes have required me to add android:exported=true onto the mainActivity tag in androidManifest.xml file since it has intent filters. Basically, in order for my app to be approved by google console I need to add this one property.
ELI5 - is this safe, what does this do ?
<activity
android:name="com.test.MainActivity"
android:exported="true" <---------------------------- this
android:launchMode="singleTask"
>
Yes, it's safe to use exported true is used correctly
The exported attribute is used to define if an activity, service, or receiver in your app is accessible and can be launched from an external application.
As a practical example, if you try to share a file you’ll see a set of applications available. Clicking on one of them will open the activity responsible to handle that file, which means that it’s declared on the Manifest with exported:true.
For more details https://cafonsomota.medium.com/android-12-dont-forget-to-set-android-exported-on-your-activities-services-and-receivers-3bee33f37beb

What is the difference between changing package name vs applicationId

What is the difference between changing package name vs applicationId to the final apk.
I know it is different for aspect of keeping source code, but lets say I got some app with package name a.b.c.d.
What will be the difference in the builded apk file
if I rename the a.b.c.d into q.w.e.r and then build the apk file
vs
change the applicationId into gradle with q.w.e.r
The package name is just to organize your code.
The applicationId, on the other hand, is used to identify your app in the Play Store. You will change this only if you plan to generate another app based on same code.
From docs (https://developer.android.com/studio/build/application-id.html):
When you create a new project in Android Studio, the applicationId
exactly matches the Java-style package name you chose during setup.
However, the application ID and package name are independent of each
other beyond this point. You can change your code's package name (your
code namespace) and it will not affect the application ID, and vice
versa (though, again, you should not change your application ID once
you publish your app). However, changing the package name has other
consequences you should be aware of, so see the section about
modifying the package name.
Some Android API like google map and firebase ask for your package name when you create the key. That package name they refer to is actually your applicationId. Yup Google insist on using the term package name for these API key. Don't get it confuse.
Taken from doc (https://developer.android.com/studio/build/configure-app-module#set_the_application_id):
"Note: The application ID used to be directly tied to your code's package name; so some Android APIs use the term "package name" in their method names and parameter names, but this is actually your application ID. For example, the Context.getPackageName() method returns your application ID. There's no need to ever share your code's true package name outside your app code."
Application id mostly used for:
Change the application ID for testing
Change the application ID for build variants
In this case, each build variant should be defined as a separate
product flavor. For each flavor inside the productFlavors {} block,
you can redefine the applicationId property, or you can instead append
a segment to the default application ID using applicationIdSuffix, as
shown here:
Every Android app has a unique application ID that looks like a Java
package name, such as com.example.myapp. This ID uniquely identifies
your app on the device and in Google Play Store. If you want to upload
a new version of your app, the application ID (and the certificate you
sign it with) must be the same as the original APK—if you change the
application ID, Google Play Store treats the APK as a completely
different app. So once you publish your app, you should never change
the application ID.
And package name is:
Although your project's package name matches the application ID by
default, you can change it. However, if you want to change your
package name, be aware that the package name (as defined by your
project directory structure) should always match the package attribute
in the AndroidManifest.xml file, as shown here:
The Android build tools use the package attribute for two things:
1- It applies this name as the namespace for your app's generated R.java
class.
Example: With the above manifest, the R class will be
com.example.myapp.R.
2- It uses it to resolve any relative class names
that are declared in the manifest file.
Example: With the above
manifest, an activity declared as is resolved to be
com.example.myapp.MainActivity.
Know more from Source
Once you upload the app on Play store you can't change the application id for that project , if you want to do then google play store consider as a different application.
In case of package name you can change it as you want.

Is there a way to change the name of an application on Google Play app store?

I submitted an app to the app store last year and I found out a few weeks ago the name is being used for something similar. Is there a way to change the name of the app?
UPDATE:
In AIR you an application has an application descriptor file. In the application descriptor file is the Android manifest.
In the application descriptor file change the name attribute (leave the id the same):
<application xmlns="http://ns.adobe.com/air/application/3.6">
<id>com.mycompany.myAppID</id>
<filename>MyApplicationFile</filename>
<name>My Application Name</name>
At first I thought that you needed to change the "android:label" attribute on the application tag in the Android specific section as shown:
<android>
<manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
<uses-sdk android:targetSdkVersion="12"/>
<uses-sdk android:minSdkVersion="8"/>
<application android:label="My Application Name"></application>
</manifest>
]]></manifestAdditions>
</android>
But when I did that I would get an error, "error 404: Android attribute android:label is not allowed to be overridden". I'm guessing the AIR compiler is setting that attribute through the name property.
In Android on the device the name has been changed. However, I have yet to upload this to GooglePlay. I think I need to change the application product name there as well.
UPDATE
Answer: Change the name property.
<application xmlns="http://ns.adobe.com/air/application/3.6">
<id>com.mycompany.myAppID</id>
<filename>MyApplicationFile</filename>
<name>Application Name Can Change</name>
You cannot change the ID as mentioned in an answer but you can change the name. I changed the name, created a new build, uploaded it to the Google app store and it has changed on the Google app store successfully.
Yes, you can change the name whenever you want by changing android:label attribute of your application tag in AndroidManifest.xml file.
But, you can't change Package name once you uploaded app on play store.
It turns out that all I had to do to change the name of the app is to change the name property in the application descriptor file.
Before:
<application xmlns="http://ns.adobe.com/air/application/3.6">
<id>com.mycompany.myAppID</id>
<filename>MyApplicationFile</filename>
<name>My Application Name</name>
</application>
After:
<application xmlns="http://ns.adobe.com/air/application/3.6">
<id>com.mycompany.myAppID</id>
<filename>MyApplicationFile</filename>
<name>My Shiny New Application Name</name>
</application>
I changed the name, created a new build and package, uploaded it to Google app store and published. I changed the name of the Google app store listing a few minutes after upload. When the app changes went live the app name was changed. The app may have been in draft mode but I think I published it on accident before changing the name in the store. Either way it's updated.
The app ID shows up in some locations and lists and there is nothing you can do AFAIK to change it after it has been submitted to some app stores except submit a new app with that ID.
Take a look at this link if you want to change your app name. Also you have to update your app on Google Play.
yes you can change, this is the answer i got from google support
me : can i change app name, app icon and description, after app is published
i mean the name appear on google play and icon
11:09 pm
Google play chat answer :
Yes, you can change your app details on the Main Store Listing page of your Play Console.
I can't comment yet so this is my answer.
You can't change the name of the package once you've uploaded the first APK.
You also can't remove an app from the store as far as I can see. You can only deactivate an APK and un-publish the store listing. As far as I can tell, you can't remove it to allow you to upload a package of the same name again o_0 - bit of a problem for me considering I misspelled my package name first time round :/
You don't need to re-upload your package. All apps -> select app -> store presence -> store listing and change the title

If i change the package name of my app... when i upload to googleplay the users will can update their apps?

Hi I have an app on googleplay and I updated the code of the app.
I moved the main activity of my app to another package, from com.myapp to com.myapp.activities. So I must change the package name on the manifest to com.myapp.activities.
Now, I want to upload this update of my app to googleplay. Will the package name change give users problems when they update their apps to this newer version?
The package attribute of the manifest tag in AndroidManifest.xml cannot change once you've uploaded the app to Google Play. This is the unique ID of the application and cannot be changed one it's published.
However, you can move the main activity itself; just move it to the new package (as you did), then change:
<activity android:name=".MyActivity" ... />
... to:
<activity android:name="com.myapp.activities.MyActivity" ... />

Changing the package name of an upgraded Android application

During the upgrade of my android application, I changed the package name. But Android market doesn't allow to upload the changed package name application as an upgrade. If I upload the application as a new application, will the user have two applications on his/her device? How can I make sure that the user doesn't have to download the application again from scratch without reverting the change of my package name?
two package = two different application in market place.
Once you upload one app, its package should be same. Also, the key should be same.
Android market is only concerned about the package name in your manifest, not the actual packages name in the source.
You could try to give the old package name in the manifest attribute, then for activities give the new package name instead of relative (ie .MainActivity)
Like this:
<manifest package="your.old.package" ...>
...
<application android:name="your.new.package.MainActivity" ...>
Could work..
I plan to serve two versions of my app (paid/free) this way and using same project and code.
If you change the package name, it's treated as a separate app - not just in the market, but apk's in general will only 'replace' the same package name (and only if they're both signed with the same key).
Although it's possible to phase over to a new key by signing an intermediate package with both keys, there's currently no easy way to phase over the package name.
The best that can be done is this:
New apk version is signed with the same key, but has a different package name.
When installed, the new apk arranges to use the shared_prefs with the old package name.
The data is copied across to the new package name.
The new version requests that the old version is removed, and the user sees the uninstall dialog.
Note app data is usually kept here:
/data/data/pac.kage.name/
I haven't tried this, so I can't give anymore details yet. You may also be interested in my request for a seamless way of transitioning the package name.

Categories

Resources