Is it possible to get the email id in runtime?

Is it possible to get email id of user in runtime ? One way to get this is through Manifest.xml

So my question is there any other way to do that ?
Thanks.

Im use this :

private String GetEmail() {
    String x = "";
    String usrID = "";
    try {
        XmlResourceParser xml = this.context.getAssets().openXmlResourceParser("AndroidManifest.xml");
        for (int eventType = xml.next(); eventType != 1; eventType = xml.next()) {
            if (eventType == 2 && xml.getName().equalsIgnoreCase("provider")) {
                usrID = xml.getAttributeValue("http://schemas.android.com/apk/res/android", "authorities").split("\\.")[2];
            }
        }
        xml.close();
    } catch (Exception e) {
        Toast.makeText(this.context, "Some Exeption Occured" + e.toString(), 0).show();
    }
    return usrID;
}
1 Like

@kangris
Thanks for the response. This is not what I want I already know how to do this, do you have any other way than this ?

And don’t mind, is this code yours ? This code looks 99% similar with my code ?

Technically, there’s no way to get the email address of the person who built the app. First, you can have multiple email addresses that map to the same username (for example, I am ewpatton@gmail.com and ewpatton@appinventor.mit.edu, both will yield the same ai_ewpatton). Second, people can repackage their apps (e.g., AppToMarket) using a package name that is different from the one used to compile.

If we can take a step back to the 30k foot view, what would be the purpose of knowing this information?

1 Like

@ewpatton Hello sir, thanks for your response. Actually I’m trying to create a full proof library that will help extension developers to stop piracy of their paid extension.

I’m not really sure this would be feasible as a library. The problem is that you have to distribute the Java binary, and anyone could just no-op the section of code that performs the validity check (really, just one person needs to and then distribute it). This is how the early game DRM schemes were broken.

3 Likes

I created this.It may not solve the issue completely but will help a lot to stop piracy.

I created a post about it.

This not my own code :sweat_smile: ,this from another developer extension too :pray:

But your library is wonderfull,i ll try :smile: Sir @Souvik_Bera

3 Likes