Where should i add <supports-screens> in Android tiapp.xml - java

[WARN] For your density-specific images
(android/images/high|medium|low|res-*)
to be effective, you should put a
element with
anyDensity="true" in the
section of your
tiapp.xml or in a custom
AndroidManifest.xml
I get this warning in my emulator. Now where do i add <supports-screens> in my tiapp.xml
<?xml version="1.0" encoding="UTF-8"?>
<ti:app
xmlns:ti="http://ti.appcelerator.org">
<id>com.gfg.gfgfg</id>
<name>fgfgfgf</name>
<version>1.0</version>
<publisher>uuuu</publisher>
<url>http://www.uuu.com</url>
<description>No description
provided</description> <copyright>2011
by John</copyright>
<icon>default_app_logo.png</icon>
<persistent-wifi>false</persistent-wifi>
<prerendered-icon>false</prerendered-icon>
<statusbar-style>default</statusbar-style>
<statusbar-hidden>false</statusbar-hidden>
<fullscreen>false</fullscreen>
<navbar-hidden>false</navbar-hidden>
<analytics>true</analytics>
<guid>cba0a3f5-1d77-4cb2-bac0-4fb27109f48b</guid>
<iphone>
<orientations device="iphone">
<orientation>Ti.UI.PORTRAIT</orientation>
</orientations>
<orientations device="ipad">
<orientation>Ti.UI.PORTRAIT</orientation>
<orientation>Ti.UI.UPSIDE_PORTRAIT</orientation>
<orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
<orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
</orientations>
</iphone>
<android xmlns:android="http://schemas.android.com/apk/res/android">
</android>
<modules></modules>
</ti:app>

Im not sure what file you are showing but the supports-screens value is set using the manifest file; which (I believe) needs to be called AndroidManifest.xml.
Here is the full details: http://developer.android.com/guide/topics/manifest/supports-screens-element.html
A manifest file usually looks like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dsfdsfds.dasdsa"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".dsfdsfds"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<supports-screens android:anyDensity="true" />
</manifest>
And <supports-screens> can be put anywhere inside <manifest>
Can someone back me up here though; does the posters XML look like a manifest file for android?

Related

Malformed Manifest - Tag <activity> missing required attribute name

I keep getting the Tag activity missing required attribute name, Tag action missing required attribute name, and Tag category missing required attribute name errors when attempting to run my app. Manifest file follows:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.caom/apk/res/android"
package="com.cobyllamarco.morsoul"
android:installLocation="preferExternal"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="3"
android:targetSdkVersion="17" />
<application
android:name=".MorsoulDemo0"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="Morsoul Demo"
android:theme="#style/AppTheme" >
<activity
android:name=".MorsoulDemo0"
android:label="Morsoul Demo0"
android:screenOrientation="landscape" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I combed through to set all packages to lower case and sent it through an XML validator online(came back valid). Help please...
You have a typo in namespace.
xmlns:android="http://schemas.android.caom/apk/res/android"
There should be com, not caom.
I've tried to make this typo and get the same result: "missed 'name' attribute".
Your application & activity tags seem to have same attribute 'name=.MorsoulDemo0'. Only give an Application subclass as name attribute of application tag & give an Activity as name attribute of activity tag.

live wallpaper-settings button is not working

okay, this is my very first application which i am working on, everything works fine until i wanted to add a settings button to my live wallpaper, the problem is, when i simply hit "settings" it comes with this message of "live wallpaper picker has stopped". here's my code
Android manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.Live.zaki"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="16" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.ui.MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="true"
android:label="#string/app_name"
android:theme="#style/FullscreenTheme" >
/>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
android:label="#string/appName"
android:icon="#drawable/icon">
<service
android:name="com.Live.zaki.CustomWallpaper"
android:label="#string/appName"
android:permission="android.permission.BIND_WALLPAPER" >
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data
android:name="android.service.wallpaper"
android:resource="#xml/wallpaper" />
</service>
<activity
android:name="com.example.ui.SecondActivity"
android:label="Home" >
</activity>
<activity
android:name=".PrefsActivity"
android:theme="#android:style/Theme.Black.NoTitleBar" >
</activity>
</application>
</manifest>
wallpaper.xml
<wallpaper xmlns:android="http://schemas.android.com/apk/res/android"
android:thumbnail="#drawable/icon"
android:description="#string/appDescription"
android:settingsActivity="com.Live.zaki.PrefsActivity"
/>
prefs.xml
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="#string/general_lwp_settings">
<CheckBoxPreference
android:key="lwp_o_scroll_lock_key"
android:summary="#string/lwp_o_scroll_lock_summary"
android:title="#string/lwp_o_scroll_lock_title"
android:defaultValue="false" />
<CheckBoxPreference
android:key="lwp_auto_animation_key"
android:summary="#string/lwp_auto_animation_summary"
android:title="#string/lwp_auto_animation_title"
android:defaultValue="false" />
</PreferenceCategory>
PrefsActivity.java
public class PrefsActivity extends PreferenceActivity{#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(com.Live.zaki.R.xml.prefs);
}
}
i haven't yet configured any preference logic on my main livewallpaper.java code, i just want that settings menu to popup "two checkbox in my case". Is this even possible ??
if anyone could help me, that would great !! tips, tutorials anything !!
here's my application results without settings,
https://drive.google.com/file/d/0B44QwXQHh5irNFRnYkhzdDhPM00/edit?usp=sharing
buddy add exported flag in setting activity and set it true android:exported="true"
change the package name in your xml folder wallpaper.xml file to a fully qualified name.
android:settingsActivity="yourPackagename.PrefsActivity"
in the Manifest file add:
<activity
android:exported="true"
android:name=".PrefsActivity"
android:theme="#android:style/Theme.Black.NoTitleBar">

I have AAPt error on my Android xml file: Tag <category> attribute has invalid character

I have an Android xml file that includes splash and one another activity ım planıng to pass one to another while using ınytent in this context I created a default and launcher category
but eclipse is giving me error that: Tag <category> attribute has invalid character
(actually there is no invalid character)
here is my xml code
(boldline is the line that error occurred)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tesbih"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.tesbih.TesbihMainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
**<category android:name="android.intent.category.DEFAULT "** />
</intent-filter>
</activity>
<activity
android:name="com.tesbih.Splash"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
here is also my logcat
Description Resource Path Location Type
The value of the local variable timer is not used Splash.java /Tesbih/src/com/tesbih line 15 Java Problem
Tag attribute name has invalid character ' '. AndroidManifest.xml /Tesbih line 21 Android AAPT Problem
the reason of thıs problem is a bug that bundle has. if you save everythıng and exit
then when you open agaın you should go your xml fıle after makıng anychanges on the name of android name you can save and re exit again when you open your eclipse and android manifest your error sign will be lost

Android "Hello World" Error

I'm new to Android development. I'm running Eclipse with the ADT plugin and installed all the necessary dependencies. I open up Eclipse, select 'New Android Applciation' and everything is set. When I run the app, I get an error message saying
/home/parallels/workspace/test/AndroidManifest.xml: 2: /home/parallels/workspace/test/AndroidManifest.xml: Syntax error: newline unexpected
So I look in Android Manifest and it's just the default, Eclipse generated code, right? What's the problem here?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.test.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Is there any empty space above your first line in your manifest? That has to be at the very top. Also have you compiled anything successfully thus far? Maybe something didn't get imported properly. I recommend android studio. It's just Googles modified version of eclipse that specializes in android development. It comes with everything you need all ready to go.

NoClassDefFoundError in FragmentMapActivity

I've seen this question asked often, but none of the proposed solutions seem to be working for me. I'm getting
E/AndroidRuntime(897): java.lang.NoClassDefFoundError: android.support.v4.app.FragmentMapActivity$4
when attempting to open a new FragmentMapActivity.
Code:
public class Maps extends FragmentMapActivity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.maps_simple);
//MapView for the lose :(
Toast.makeText(this, R.string.map_warning, Toast.LENGTH_LONG).show();
MapView mapView = (MapView)findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
}
#Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
R.layout.maps_simple contains:
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="<key removed for security>"
/>
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="osmstudios.mappingapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="13" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<application android:icon="#drawable/icon" android:label="#string/app_name" android:theme="#style/Theme.MapApp" android:hardwareAccelerated="true">
<uses-library android:name="com.google.android.maps" />
<activity android:label="#string/app_name" android:name=".AppMainActivity">
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="#string/app_name" android:name="com.keyes.youtube.OpenYouTubePlayerActivity"></activity>
<activity android:label="#string/app_name" android:name=".Maps">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="osmstudios.mappingapp" />
</intent-filter>
</activity>
</application>
</manifest>
Here is the inner code of the button press that opens the FragmentMapActivity intent:
Intent intent = new Intent(ctx, Maps.class);
startActivity(intent);
Finally, this is what my Libraries folder in the Java Build Path tool look like:
I've been really beating my head against a wall on this one. Any help would be appreciated.
This is bit late but I had the exact same issue and could at least resolve the "java.lang.NoClassDefFoundError:". In project property->java Build path -> Libraries, I had included android-support-v4.jar from android sdk path. This lib was available during compile time but not at run time. You need to copy this jar from sdk path to application libs location that way this lib is statically added to your app and could be found during run time. hope this helps. This solution I found after lots of search in StackOverFlow. Hers is the link. Trying to use DialogFragments via v4 compatability causes NoClassDefFoundErrors
It turns out the issue had to do with a change in Android versions.
More information and the fix can be found http://www.wiseappsllc.com/homepage/android-dev-tips
I had same problem, then i resolved it by checking the build path of the project. There i had two map jars. I deleted one in libraries, Now it is working fine. Just check it may work.

Categories

Resources