Reputation: 43
So I've been trying to make some app and was looking for some inspiration. I was browsing one app on github and was looking at the code. There was numbers along with the attributes. I don't understand what are those numbers. Can anyone help explain what are these numbers in those android files?
public static final class attr {
public static final int actionBarDivider = 2130772069;
public static final int actionBarItemBackground = 2130772070;
public static final int actionBarPopupTheme = 2130772063;
public static final int actionBarSize = 2130772068;
public static final int actionBarSplitStyle = 2130772065;
public static final int actionBarStyle = 2130772064;
public static final int actionBarTabBarStyle = 2130772059;
public static final int actionBarTabStyle = 2130772058;
public static final int actionBarTabTextStyle = 2130772060;
public static final int actionBarTheme = 2130772066;
public static final int actionBarWidgetTheme = 2130772067;
public static final int actionButtonStyle = 2130772093;
public static final int actionDropDownStyle = 2130772088;
public static final int actionLayout = 2130772023;
public static final int actionMenuTextAppearance = 2130772071;
public static final int actionMenuTextColor = 2130772072;
public static final int actionModeBackground = 2130772075;
public static final int actionModeCloseButtonStyle = 2130772074;
public static final int actionModeCloseDrawable = 2130772077;
public static final int actionModeCopyDrawable = 2130772079;
public static final int actionModeCutDrawable = 2130772078;
public static final int actionModeFindDrawable = 2130772083;
what are those numbers after the equal signs?
and they have been used in another android java files of the same app like this..
this.et = (EditText) findViewById(PT1293.id.etRoll);
this.Scloth.setAdapter(new ArrayAdapter(this, 17367049, this.branch));
Upvotes: 0
Views: 92
Reputation: 465
Those numbers are generated in The Project's R Class
Once you externalize your app resources, you can access them using resource IDs that are generated in your project's R class. This document shows you how to group your resources in your Android project and provide alternative resources for specific device configurations, and then access them from your app code or other XML files.
For example, if string1 has id 4445 then R.string.string1 is 4445
But usually (always) to access a resource, we do not hardcode the Resource identifier as int like this. Instead, they are generated, we access the Resource using R.string.string1 for example.
As @CommonsWare stated, it look like reverse engineering of an Apk,
For more infos see here.
Upvotes: 4