using 'in.' in the android app id (eg. in.example.myapp) - android

I wanted to know whether I can use 'in.' in in the app id.
For example.. can i create my app id like this
in.example.myapp
As I am unable to create it using cordova CLI. But I have changed it in the config.xml
here is the error i am getting
cordova create MyApp in.example.myapp MyApp -d
CordovaError: App id contains a reserved word, or is not a valid identifier.
at C:\Users\USer\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\create.js:106:19
at Promise.apply (C:\Users\USer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1078:26)
at Promise.promise.promiseDispatch (C:\Users\USer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:741:41)
at C:\Users\USer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1304:14
at flush (C:\Users\USer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:355:11)
at Function.Module.runMain (module.js:503:11)
at startup (node.js:129:16)
at node.js:814:3
Can I publish such app on play store?
Please reply guys..
thanks in advance

From official documentation:
A full Java-language-style package name for the application. The name
should be unique. The name may contain uppercase or lowercase letters
('A' through 'Z'), numbers, and underscores ('_'). However, individual
package name parts may only start with letters.
To avoid conflicts with other developers, you should use Internet
domain ownership as the basis for your package names (in reverse). For
example, applications published by Google start with com.google. You
should also never use the com.example namespace when publishing your
applications.
The package name serves as a unique identifier for the application.
It's also the default name for the application process (see the
element's process process attribute) and the default
task affinity of an activity (see the element's
taskAffinity attribute).
Caution: Once you publish your application, you cannot change the
package name. The package name defines your application's identity, so
if you change it, then it is considered to be a different application
and users of the previous version cannot update to the new version.
yes, you can use "in." on it... the "com." thing is like a domain ownership, that's all. Read: http://developer.android.com/guide/topics/manifest/manifest-element.html
EDIT: This is Cordova documentation
The element's id attribute provides the app's reverse-domain
identifier, and the version its full version number expressed in
major/minor/patch notation.
Is not an Android limitation neither Play Store limitation if is Cordova limitation there is nothing you could do... if not, post the error; but, again... is not an Android/Play Store limitation.

"in" is a reserved keyword in Javascript. Since Cordova is built using JS, you can't use it in your package name. As noted by Mariano above, it is not an Android/Play Store limitation.
Here's a list of all reserved keywords:
break case class catch const continue debugger default delete do else
export extends finally for function if import in instanceof let new
return super switch this throw try typeof var void while with yield

Related

Why are android apps named com.something.something with cordova?

What is the naming convention for android apps?
I just kicked off my 1st cordova app and out of the box it is named com.example.hello..
If my app is called "guitars" can the id not just be that?
From: Android - Package Name convention
I understand the company name coming 1st.. but i don't follow why com is preceding it
Android apps have always been named like this. It comes from Java naming. If you have an app named "guitars" it would show as com.john.guitars
Com = commercial application (just like .com, most people register their app as a com app)
First level = always the publishing entity's' name
Second level (optional) = sub-devison, group, or project name
Final level = product name
In Android, in order to get a unique identifier you need to put something that is unique to your app, and here comes your domain into place since there is only one domain with the same name, like email for example.
This will help the device recognize your app. The reason for com at the beggining is because its an old convinient from java, it helps group apps in the same place. You can of course still do org.my.domain and it will work the same but will be in a different "folder" on the device.
So the naming convention is just your domain upside down + the name of the app, There for, guitars will be in the end if the name of the app is Guitars.
The appId can be any string. So you can set it to whatever you want, including just "guitars". However, the appId must be unique on a device. If another app that is already installed has the appId as "guitars" then your app will not install. To help avoid this, Google recommends that you use a "reverse domain name". For companies that already own a domain this can help avoid name collisions since com.google is "owned" by Google and com.samsung is clearly from Samsung.
This practice comes from using reverse domain names for Java packages. See What is the significance of the reverse domain name for java package structure for an explanation.

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.

Issues with application signature

I'm trying to create my own version of Gesture Builder. In eclipse I selected android project from existing code and I renamed the project and package name to new gesture. Then I added in android:fadeOffset = "1000" in create gesture xml(so that I can create gestures for letters like t and f) and in AndroidManifest.xml I set the version name to NewGestures and I set a different icon but when I try to run it I get this error message:
"Re-installation failed due to different application signatures. You must perform a full uninstall of the application. WARNING: This will remove the application data! Do you want to uninstall?"
From what I've seen online I need to match the signature used originally on Gesture Builder, but I've no idea how to do this on eclipse, shouldn't the signature have been handled properly when I created from existing code? Any help would be very much appreciated. I just need this app working so I can get a gestures library for a different application I'm working on for college.
This message concerns the application signature. This happens when you are trying to install an application on your device while an application of the same package name is already installed, but signed with a different certificate (see details here).
For example:
You have exported and installed your application using your Google Play keystore (so using your actual developer's certificate), and now you are running/debugging it from Eclipse, implicitely using the debug certificate (which is different)
You have runned/debugged your application from Eclipse at home on this device, and now your are running it/debugging it from Eclipse with another computer (which is using a different implicit debug certificate)
etc
Normally, below the error message, you have a button that allows uninstalling/reinstalling. If not, just uninstall your app manually and everything will be fine again.
versionName:
The version number shown to users. This attribute can be set as a raw
string or as a reference to a string resource. The string has no other
purpose than to be displayed to users.
package:
The package name serves as a unique identifier for the application.
The package name declared in your manifest.xml is what makes your application unique. Therefore, there can not be two application installed with the same package name at the same time. If you try this, your error occurs.

Are these two treated as same package names in android

So I have published an app on google play, but unfortunately I forgot the alias password for the signing certificate though I remember the password with which I signed the certificate.
After searching a lot I have come to a conclusion that I can't retrieve the alias password by any means and now I am publishing a new copy of app on google play.
Also I went through this post by Dianne Hackborn,
things-that-cannot-change.html
and package name is one out of them.
So , now if I publish this new app with the same package name and un-publish the existing app and a user who has installed the existing app with the existing package name now installs this new app I think that would be an error according to the above post.
But according to the package name conventions I have named the package as,
com.mycompanyname.beta
and for this new upload of the app , I want to use the package name,
com.mycompanyname.android so would these packages conflict ?
com.mycompanyname.beta and com.mycompanyname.android are different package names, so no, they won't conflict.
If a user has the first app installed (com.mycompanyname.beta), and then installs the second one (com.mycompanyname.android), they will end up with both apps installed on their device.
The app is identified by the package name. Therefor the package name needs to be unique. Thats why everybody uses some domain names for that to create a unique package (domains are unique, too).
They wont' conflict
com.mycompanyname.beta
com.mycompanyname.android
but for the safe use-case, this will do the work
com.mycompanyname.clientname.android
Changing package name will not be issue , Android SDK will handle references efficiently
From Android package Specifications
A full Java-language-style package name for the application. The name
should be unique. The name may contain uppercase or lowercase letters
('A' through 'Z'), numbers, and underscores ('_'). However, individual
package name parts may only start with letters. To avoid conflicts
with other developers, you should use Internet domain ownership as the
basis for your package names (in reverse). For example, applications
published by Google start with com.google. You should also never use
the com.example namespace when publishing your applications.
The package name serves as a unique identifier for the application.
It's also the default name for the application process (see the
element's process process attribute) and the default
task affinity of an activity (see the element's
taskAffinity attribute).
Caution: Once you publish your application, you cannot change the
package name. The package name defines your application's identity, so
if you change it, then it is considered to be a different application
and users of the previous version cannot update to the new version
.
NO there will not be any conflict rather then made a copy of your app with different package
com.mycompanyname.beta and com.mycompanyname.android are different package names of your app.
It never be conflict each over. Both app can be installed in same device.
If it is conflict then better to check the manifest file of app package. May have same package. Then it make conflict. Your App package name should be like that
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycompanyname.beta"
android:versionCode="1"
android:versionName="1.0" >
</manifest >
and other one
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycompanyname.android"
android:versionCode="1"
android:versionName="1.0" >
</manifest >

com.example package name not allowed in Google Play

I'm new to android application development. I'm creating simple android application.
Export the android application and give the package name as AndroidManifestfile packagename as
com.example.zingyminds.apk
Now I got the apk file and upload to the google play at that time I got the below error message please anyone help me.
The package name of your apk may not begin with any of the following values: [com.android, com.google, android, com.example]
Packages are typically named using the following convention:
[org/com].[company].[product].[component]
By convention, package names should not contain capitals.
Google Play identifies all the applications on the basis of their package name, so some of the names are reserved for the default applications of the android, like you have mentioned in the last paragraph,
[com.android, com.google, android, com.example]
so, these package name are discouraged and you should use the upper conventions for describing the package name, something like this,
com.zingyminds.apk
Rename your package name com.example.zingyminds.apk to com.zingyminds.apk
Google Play doesn't care about the filename of your application. It cares
about the package name defined in the manifest.
If you observe properly, the fourth value in error message is 'com.example' which is same as starting of your package com.example.zingyminds... Rename your package to something else which is not listed in the message, it will solve your problem.
Packages are typically named using the following convention:
[com.android, com.google, android, com.example]
so, these package name are discouraged and you should use the upper conventions for describing the package name, something like this,
if you want to mention example in your package name, try this
com.zingyminds.example.apk

Categories

Resources