I'm working with android studio to develop Android app. I'm working on the creation of a template to use in my applications. I have read the Android IDE Template Format specification and so i start my personal template starting from Dummy template.
I have a .ftl file with the following line of code:
<applicationGestureListenerClazz>${projectPackageName}.listeners.${projectShortName}GestureListener</applicationGestureListenerClazz>
When i execute the template i obtain the following line:
<applicationGestureListenerClazz>org.abubu.dummy.listeners.DummyGestureListener
</applicationGestureListenerClazz>
The variables are correctly defined (in other file they work fine). I don't known why.. it add a CRLF after this line.
Anybody has analogue problem?
UPDATE
I discover that the problem is linked to extension of output file. For example. I have a file **license_key_strings.txt.ftl* that contains:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- public key di ${projectPackageName}.key-->
<string name="publicKey">${licenseKey}</string>
</resources>
<!-- fine -->
If i use it to create a xml file
<instantiate from="root/key/src/main/res/values/license_key_strings.txt.ftl" to="${keyBaseDir}/src/main/res/values/license_key_strings.xml"/>
I obtain this file:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- public key di org.dummy.key-->
<string name="publicKey">
MIIBIjANBgkqhkiG9w0BAQ
</string>
</resources>
But the output filename ends with .txt
<instantiate from="root/key/src/main/res/values/license_key_strings.txt.ftl" to="${keyBaseDir}/src/main/res/values/license_key_strings.txt"/>
The final output become:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- public key di org.dummy.key-->
<string name="publicKey">MIIBIjANBgkqhkiG9w0BAQ</string>
</resources>
<!-- fine -->
I'm working with Android Studio 1.4
I am integrating Fusion chart in my Flex 4.6 web application, it is working fine but when i try to use the same set of code in AIR it throws run time error as like below
VerifyError: Error #1014: Class mx.controls::Image could not be found.
at FusionChartSample/init()[D:\WorkspaceLocal\TabletSamples\FusionChartAppln\FusionChartSample.mxml:15]
at FusionChartSample/___FusionChartSample_Application1_creationComplete()[D:\WorkspaceLocal\TabletSamples\FusionChartAppln\FusionChartSample.mxml:4]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152]
at mx.core::UIComponent/set initialized()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:1818]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:842]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]
Here is my sample code working fine in Web application but not in AIR,
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:components="com.fusioncharts.components.*" xmlns="*" creationComplete="init()" >
<fx:Script>
<![CDATA[
import com.fusioncharts.components.*;
import spark.components.Button;
private var _fusionChart: FusionCharts;
private var sampleXml:XML;
private function init():void {
_fusionChart = new FusionCharts();
_fusionChart.FCChartType = "StackedColumn2D";
_fusionChart.FCDataXML = sampleXml;
_fusionChart.FCFolder = "../fusioncharts/";
_fusionChart.FCRender();
this.addElement(_fusionChart);
}
]]>
</fx:Script>
</s:Application>
If anyone comes across this problem, kindly provide me some idea. Thanks in advance.
The above code snippets has few problems. First ensure that you are not using Spark Only Component set. Set MX + Spark Component.
I am not sure why the above code snippet is showing "s:Application". If this is an AIR app it should be "s:WindowedApplication".
The attribute FCDataXML is pointing towards a string which is probably the name of the XML file. You need to specify the actual XML there.
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.
Using the DDMS view in Eclipse, I see there is the possibility of using KML files to feed locations to the AVD. I have an app that listens for locations and moves a Google mapview around, drawing lines from one spot to another. When I manually feed it using the manual tab it works fine.
However when I try to open a valid KML file, nothing happens. I have hundreds of valid KML files that work just fine in Google Earth, Bing Maps, and Google Maps. But the DDMS emulator control does not open them. No error of any kind, it just doesn't open them. I pasted a small KML file below.
(There is a problem with this forum software. When I paste code and such it does not capture everything so it looks like an invalid file but it's not. It usually catches the first line, skips a bunch of other lines, and then shows the rest of the file. It does this with Java code too).
Thanks,
Gary
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Name>_Name</Name>
<Style id="mTTPathStyle">
<LineStyle>
<color>aaff0000</color>
<width>4</width>
</LineStyle>
</Style>
<Style id="StartIconStyle">
<IconStyle>
<Icon><href>http://dl.dropbox.com/u/39662979/start.png</href></Icon>
<hotSpot x="0.5" y="0.0" xunits="fraction" yunits="fraction" />
</IconStyle>
</Style>
<Style id="FinishIconStyle">
<IconStyle>
<Icon><href>http://dl.dropbox.com/u/39662979/finish.png</href></Icon>
<hotSpot x="0.5" y="0.0" xunits="fraction" yunits="fraction" />
</IconStyle>
</Style>
<Folder>
<name>Test1</name>
<open>1</open>
<Placemark><name><![CDATA[6/3/2012 4:00:34 PM]]></name><visibility>1</visibility><styleUrl>#StartIconStyle</styleUrl><Point><coordinates>-111.03501118, 31.79118389, 893.5 </coordinates></Point></Placemark>
<Placemark><name><![CDATA[6/3/2012 4:01:55 PM]]></name><visibility>1</visibility><description>Test1 0.37 Miles 1 min, 21 sec 16.7 MPH</description><styleUrl>#FinishIconStyle</styleUrl><Point><coordinates>-111.03053401,31.79307061,932.299987792969 </coordinates></Point></Placemark>
<Folder><name><![CDATA[Path]]></name><open>0</open><Placemark><name>only Segment for now</name><styleUrl>#mTTPathStyle</styleUrl><LineString><extrude>0</extrude><tessellate>1</tessellate><altitudeMode>clampToGround</altitudeMode><coordinates>-111.03501118,31.79118389,893.5 -111.0352843,31.79227626,917.299987792969 -111.03510817,31.79219134,927.099975585938 -111.03491294,31.79222276,927.5 -111.03483045,31.79230171,928 -111.03465771,31.79236738,929.799987792969 -111.03418779,31.79235829,933.799987792969 -111.03282738,31.79241828,934.799987792969 -111.03200371,31.79269077,932.099975585938 -111.03157208,31.79302646,933.900024414063 -111.0311052,31.79310853,933.599975585938 -111.03053401,31.79307061,932.299987792969 </coordinates></LineString></Placemark></Folder>
</Folder>
As it turns out what is valid KML for Google Earth, Google Maps, and Bing Maps is not valid KML for Eclipse. However there is a KML converter at http://ge2adt.appspot.com/ (need Google groupslogin creds). I converted several of my KML files and they work great now in Eclipse.
Gary Blakely
The res folder inside of bin is supposed to contain .dex,.apk and .ap_ i think.Mines gone empty somehow causing errors like not being able to access the layout resources.I have tried clean and build but it doesent seem to work.Just seem to create an empty res folder.So any idea how to fix this?
Thanks.
Ok my problem is with an xml file i'm creating inside of res/menu inorder to create an options menu:
options.xml:
<?xml version="1.0" encoding="UTF-8"?>
<menu>
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="#+id/setmenu"
android:title="#string/settings"
android:icon="#android:drawable/ic_menu_preferences"></item>
<item
android:id="#+id/helpmenu"
android:title="#string/help"
androidLicon="#android:drawable/ic_menu_help"></item>
</menu>
Heres the error i am getting:
Description Resource Path Location Type
Unparsed aapt error(s)! Check the console for output. TriviaQuiz line 1 Android ADT Problem
Console Messages:
[2011-11-19 16:47:24 - TriviaQuiz] W/ResourceType( 4672): Bad XML block: header size 116 or total size 7602372 is larger than data size 0
[2011-11-19 16:47:24 - TriviaQuiz] H:\workspace\TriviaQuiz\res\menu\options.xml:5: error: Error parsing XML: unbound prefix
Any idea what it is.
I find that an error in one of my resources (usually a layout) causes this. Missing quotes or /> in particular are a good starting point - that's my personal blind spot and eclipse punishes it mercilessly!
As alextsc says, check everything you edited recently.