According to the android Documentation
android:userVisible defaults to true and controls whether or not this sync adapter shows up in the Sync Settings screen.
but it shows in the Settings whatever value it gets!
EDIT Nov 03 2014
I removed android:icon android:label android:smallIcon from authenticator.xml and now it's not showing in the Accounts but there is an empty entry on Add Account tested on Samsung Galaxy S4. And for the record this totally crashed my 2.3.3 emulator when opening Accounts from Settings.
I have implemented my own syncadapter it's working for me as below :
Case 1: When android:userVisible="false" There is only app icon,Account name and app title
<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
android:contentAuthority="com.example.kukssyncadapter"
android:accountType="com.example.kukssyncadapter"
android:supportsUploading="false"
android:allowParallelSyncs="false"
android:userVisible="false"
/>
Case 2: When android:userVisible="true" There is app icon,Account name and app title with sync control functionality as you can see from image
<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
android:contentAuthority="com.example.kukssyncadapter"
android:accountType="com.example.kukssyncadapter"
android:supportsUploading="false"
android:allowParallelSyncs="false"
android:userVisible="true"
/>
Related
I'm doing a Hello World in Xamarin Android, but when I try to change the launcher icon, it throws the following error: "No resource found that matches the given name (at 'icon' with value '#drawable/icon')."
Actually I don't have any "icon" in my resources, the icons' names are ic_launcher:
And my manifest looks like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="HelloWorldXamarinAndroid.HelloWorldXamarinAndroid" android:versionCode="1" android:versionName="1.0" android:installLocation="preferExternal">
<uses-sdk android:minSdkVersion="16" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<application android:label="Hi android" android:icon="#drawable/ic_launcher"></application>
</manifest>
I've already cleaned the project and tried to rebuild it, can someone help me?
If I change all the images' names to "Icon.png" and the manifest with "#drawable/Icon", it works, my question is, why Xamarin doesn't work with other names
I found the problem, in Main Activity is set the icon too, so it's necessary to set the new name there too:
[Activity(Label = "HelloWorldXamarinAndroid", MainLauncher = true, Icon = "#drawable/ic_launcher")]
public class MainActivity : Activity
{
...
}
Right click the Droid project and select Android Manifest from the menu list. Under Application Icon you will see which icon the application is referencing.
Below is a picture of where the icon is being references.
I am working on HCE based App that will require payment through NFC at POS terminal.
I have followed the HCE article on android developers site and I am able to add the banner for card during installation through below code :
<host-apdu-service
xmlns:android="http://schemas.android.com/apk/res/android"
android:requireDeviceUnlock="true"
android:apduServiceBanner="#drawable/servicebanner">
<aid-group android:category="payment"
android:description="#string/paymentGroup" >
<aid-filter ... />
</aid-group>
</host-apdu-service>
But I want to add the banner when the user clicks on ADD CARD button in my app.
Can we add the banner image dynamically on button click ?
Thanks
Well.. I have a big problem my app id is "org.qtproject.example.test". I want to change to "com.mycompany.myapp". I was looking at the whole project and there is no way to change it. How do you do that?
change the package name in the Android manifest file.
manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.mycompany.myapp" android:versionCode="1" android:versionName="1.0.0"
Open the AndroidManifest.xml file of your project in Creator and it's the first setting in the manifest editor form.
Also, from QGuiApplication see the setOrganizationName(), setOrganizationDomain() and setApplicationName() functions.
I know this question is a little stupid but I cannot find where the settings of my preferences screen are stored.
I am using shared preferences this file is located at /data/data/my.package.name/shared_prefs/common.xml. However when I change something the changes are stored. I even implemented custom controls which can store their information so far. But however I cannot figure out where the settings are stored. /data/data/my.package.name/ is only one xml file which does not contain any related information. I also checked the virtual directories for multi user devices with no luck.
Here is my xml:
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res/my.package.name"
android:persistent="true" >
<PreferenceCategory android:title="#string/settings_basics_group" >
<EditTextPreference
android:key="nickname"
android:persistent="true"
android:positiveButtonText="#string/setting_change_name"
android:title="#string/settings_username" />
<my.package.name.controls.EmailPreference
android:key="mail"
android:title="#string/settings_email"
custom:domains="#array/known_email_domains" />
<Preference
android:summary="Mars"
android:title="#string/settings_current_location" />
<my.package.name.controls.DatePreference
android:key="birthday"
android:title="#string/settings_birthday" />
</PreferenceCategory>
</PreferenceScreen>
I would be really happy if somebody could explain me where these settings are stored.
For older Android versions including Jelly Bean (API 16) and older the answer of Dalmas is correct. So feel free to upvote that answer.
Beginning with Jelly Bean MR1 (API 17) there are new rules about path due the multiuser support:
I figured out that the settings file is located in /data/user/##/my.package.name/shared_prefs/my.package.name_preferences.xml where ## is my numeric user id.
For solving that path you need the ApplicationContext there you need to reflect mLoadedAPK and there mDataDir. For now I'm happy with that I could get the path from the debugger. Sorry to everyone who wants a ready to use code snippet, you have to do that yourself.
The app preferences are stored in the default shared preferences that you can retrieve with PreferenceManager.getDefaultSharedPreferences().
The XML file itself is located at /data/data/YOUR_PACKAGE_NAME/shared_prefs/YOUR_PACKAGE_NAME_preferences.xml
Hi I'm having a problem with my xml file for my android app. It's spitting out this error
error: invalid start tag Category . . . here is the source code.
<?xml version="1.0" encoding="UTF-8" ?>
<Category>
<destination id="1" main_cat="Hotel">
<timestamp></timestamp>
<business_name><![CDATA[ Sugarland Hotel ]]></business_name>
<alias><![CDATA[ Sugarland Hotel ]]></alias>
<address><![CDATA[ Araneta Avenue ]]></address>
<city><![CDATA[ Bacolod ]]></city>
<subcategory><![CDATA[ Hotel ]]></subcategory>
<cuisine><![CDATA[ Italian,Asian ]]></cuisine>
<budget> </budget>
<features> </features>
<working_days><![CDATA[ Everyday ]]></working_days>
<opening><![CDATA[ 24/7 ]]></opening>
<ending> </ending>
<contact><![CDATA[ (34)435-2690 , (34)435-2780 ]]></contact>
<fax><![CDATA[ (34)435-2645 ]]></fax>
<email><![CDATA[ rooms#sugarlandhotel.com ]]></email>
<website><![CDATA[ www.sugarlandhotel.com ]]></website>
<payment_type><![CDATA[ cash,credit card,master card, visa ]]></payment_type>
<lat><![CDATA[ 10.6524789N ]]></lat>
<long><![CDATA[ 122.9372838E ]]></long>
<desc><![CDATA[ Experience a modern hacienda retreat that nurtures the charm and romance of old world plantation living. Extensively renovated beginning 2010, Sugarland hotel unvails a celebrated balance of nostalgia and contemporary style, Capturing its original southern elegence, luxury, and decadence. Machuca tiles form cool geometric patterns in the hallways. Hacienda hardwoord floors contrast modern furnishings and amenities in the dramatic suits. The sugarland lifestyle offers guests the finest sensory indulgences: signature hacienda service, soothing organic toiletries, heirloom recipes, and unmatched privacy and tranquility. ]]></desc>
<image> </image>
</destination>
</Category>
also i tried testing CDATA would i rather use it or go with xml schema. Thanks for the help in advance
Remove the whitespace in front of <?xml version="1.0" encoding="UTF-8" ?>. Nothing can appear before it.
Both IntelliJ and my browser say your XML is fine. There must be something else wrong.