nicolas2k / google-glass-api

Automatically exported from code.google.com/p/google-glass-api
1 stars 0 forks source link

When I try to read glass app version name it is always 1.0 #342

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
    public String getApplicationVersion() {
        String version = "";

        try {
            PackageManager manager = context.getPackageManager();
            PackageInfo info = manager.getPackageInfo(
                    context.getPackageName(), 0);
            version = info.versionName;
        } catch (Exception e) {
            if (BuildConfig.DEBUG) Log.w(TAG, e);
        }

        return version;
    }

When I try to use this method to get app version name it is always 1.0. 

This code works correctly on Android device.

Original issue reported on code.google.com by alexey.v...@gmail.com on 7 Jan 2014 at 6:35

GoogleCodeExporter commented 8 years ago
Hello,

Thanks for the report! Unfortunately, I have not been able to reproduce with a 
test app and Glass running XE12.

Could you share with us the content of your AndroidManifest.xml file?

Best,
Alain

Original comment by ala...@google.com on 7 Jan 2014 at 9:12

GoogleCodeExporter commented 8 years ago
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:versionCode="49"
    android:versionName="1.3.5"
    package="......">
</manifest>

Im using X12 device and sneak peak version 2

I have tried to uninstall app with adb and install again. I still have this 
problem.

Original comment by alexey.v...@gmail.com on 8 Jan 2014 at 2:34

GoogleCodeExporter commented 8 years ago
Hum, still haven't been able to reproduce... Could you attach some source code 
that you could use?

I tried using the small snippet you posted with the Activity as the context and 
it worked perfectly.

Original comment by ala...@google.com on 9 Jan 2014 at 5:41

GoogleCodeExporter commented 8 years ago
Closing this issue as "Obsolete", please re-open if this is still relevant. 
Also attaching a demo project would help.

Original comment by ala...@google.com on 4 Feb 2014 at 12:00