For example, if you want to get the metadata_username value from a QR code that contains a URL like this:
https://example.com/login?metadata_username=john&metadata_password=1234
You can use the ZXing library to scan the QR code and get the raw data as a string:
https://example.com/login?metadata_username=john&metadata_password=1234
Then you can use a URL parser library or method to parse the URL and get the query parameters as a map:
{metadata_username: john, metadata_password: 1234}
Finally, you can access the metadata_username value from the map by using its key:
String metadata_username = map.get ("metadata_username");
To display the metadata_username value in your MainMenuActivity.xml
, you can use a TextView
element and set its text attribute to the metadata_username value:
<TextView android:id="@+id/metadata_username_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{metadata_username}" />