Android Softkeyboard Code list - java

is there a list of possible android codes out there?
I'm using the Android IME to create a custom softkeyboard.
My current XML file looks like this:
<Row>
<Key android:codes="52" android:keyLabel="4" />
<Key android:codes="53" android:keyLabel="5" />
<Key android:codes="54" android:keyLabel="6" />
</Row>
<Row>
Currently my keyboard works but I want to know what kind of keycodes I can use.
So my question is, where can I get a list of codes I can use for my softkeyboard. I only found some Keycodes from the android Documentation but they dont work.
I hope you guys can help me

Maybe you're looking for something like Generic.kl
You can also find it in "/system/usr/keylayout/", there are a loot of *.kl file.

Related

XML override component Java

I am having a component that I need to override, the problem is I don't know-how.
My XML looks like this:
<border-layout>
<component name="myFirstComponent">
<fix-layout>
<component name="myController">
some options...
</component>
<component name="needToOverride">
<fix-position x="222" y="222" width="111" height="10" opaque="false" visible="true"/>
</component>
</fix-layout>
</border-layout>
I could escape some closing tags at the end, but don't take it insight. How can I override "needTOOverride" to modify my positions? the current XML is read-only, and I can't modify it.
I tried some google solutions but did not manage to make this work. Sorry for the dumb question, if it is.
I would use some XML Serialization and Deserialization Library like jackson or simplexml for that.

Java to implement TransformationDictionary PMML model

I know there is jpmml, but it seems the jpmml only supports evaluator part from PMML.
I have a PMML model file exported from KNIME Category to Number node, and I need it in Java. some of its content like below shown:
<TransformationDictionary>
<DerivedField displayName="LIVE_STS" name="LIVE_STS*" optype="continuous" dataType="integer">
<Extension name="summary" extender="KNIME" value="Generated by KNIME - Category2Number node"/>
<MapValues outputColumn="out" dataType="integer">
<FieldColumnPair field="LIVE_STS" column="in"/>
<InlineTable>
<row>
<pmml:in>N</pmml:in>
<pmml:out>0</pmml:out>
</row>
<row>
<pmml:in>L</pmml:in>
<pmml:out>1</pmml:out>
</row>
</InlineTable>
</MapValues>
</DerivedField>
Above is only a part of it.
Any package in java can implement the logic? or if jpmml could do, which package should I use please?
I already asked the member of jpmml as issue in github.
check out this link:
the_link
it gave an alternative for this issue, which solved the problem in another way.

does android have the <defaultsMap> xml tag that firebase uses?

in firebase you can provide it a defaultsMap xml tag for keeping something like key value pairs. it looks like this:
<?xml version="1.0" encoding="utf-8"?>
<!-- START xml_defaults -->
<defaultsMap>
<entry>
<key>loading_phrase</key>
<value>Fetching config…</value>
</entry>
<entry>
<key>welcome_message_caps</key>
<value>false</value>
</entry>
<entry>
<key>welcome_message</key>
<value>Welcome to my awesome app!</value>
</entry>
</defaultsMap>
<!-- END xml_defaults -->
my question is NOT firebase related. My question is am i able to utilize this for other purposes ? i'd like to keep a defaultsMap in xml for other purposes and it wold even be so handy if i could convert it to a java Map easily. Is this tag only for firebase use ? If not how would i use it for my own purposes ? i cant find any documentation on the tag, seems poorly documented.
You can use Resources.getXml(R.xml.name) to parse any generic xml. So yes you could make up your own as well. However, there's something you should keep in mind
The XmlPullParser implementation returned here has some limited functionality. In particular, you can't change its input
taken from docs

Google AdWords Java API: Help unmarshal Ad Hoc Report

I'm using google-api-adwords-java to download some Ad Hoc AdWords reports.
The library helps me to build the request xml through usage of:
com.google.api.adwords.lib.utils.v201109.ReportUtils.toXml(reportDefinition)
I am successfully able to obtain the response xml, but I see no way through the API to map that to java objects. Is there anything within the API to help me do so or is this something I am going to have to do on my own?
(I am currently using adwords-api-8.4.2)
You will have to parse the xml on your own, since report downloads don't have corresponding POJO objects in AdWords API. Though, it should be easy to do using some basic XML parsing code. All the reports (when downloaded in xml format) looks like this:
<report>
<report-name name="Report name here"/>
<date-range date="date-range-here"/>
<table>
<columns>
<column name="columnName" display="Display name of column"/>
....
</columns>
<row columnName="value" columnName="value" .../>
....
</table>
</report>
I also wanted to mention that our primary discussion forum is at http://groups.google.com/group/adwords-api?pli=1, and I frequently answer developer questions there, so if you have any followup questions, feel free to ask there and I'll be happy to answer your questions.
Cheers,
Anash

Java replace in XML-file

I have created my own XML-file on my Android phone, which looks similar to this
<?xml version="1.0" encoding="utf-8" ?>
<backlogs>
<issue id="1">
<backlog id="0" name="Linux" swid="100" />
<backlog id="0" name="Project Management" swid="101" />
</issue>
<issue id="2">
<backlog id="0" name="Tests" swid="110" />
<backlog id="0" name="Online test" swid="111" />
<backlog id="0" name="Test build" swid="112" />
<backlog id="0" name="Update" swid="113" />
</issue>
</backlogs>
I have then converted it into a String to replace inside the string using Regular Expression, but I have a problem with the Regular Expression. The Regular Expression I just created looks like this
([\n\r]*)<(.*)issue(.*)1(.*)([\n\r]*)(.*)([\n\r]*)(.*)([\n\r]*)(.*)<(.*)/(.*)issue(.*)
I need to replace the specific issue-tag (located with the specific ID) with another issue-tag in another String
The Regular Expression works fine for the tag with ID 1, but not with ID 2 as there is another amount of tags, but is there any way to get around the use of amount?
I hope you understand my question
I finally found a solution for my question, which is
([\n\r]*)<(.*)issue(.*)1[\S\s]*?<(.*)/(.*)issue(.*)
Do not use regex. Please. Use XML parser.
Do you know what is the highest voted SO answer
Use a SAX (or StAX) parser and writer at the same time.
As you read one event, detect whether to write the same event type to the writer without modification, or to do some modifications in the state you are currently in - like swapping an element name or attribute value. This will handle an unlimited amount of elements at the expense of CPU usage; in general it will be pretty light-weight.

Categories

Resources