How to work with AndroidManifest and Assembly - xamarin.android

Base on Xamarin Studio instruction, I follow it to create the AndroidManifest which looks as below.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1"
android:versionName="1.0"
package="HelloMultiScreen.HelloMultiScreen">
<uses-sdk />
<application android:label="HelloMultiScreen">
<application>
<manifest>
I have these questions:
1) How come it DOES NOT list out all the control or widget like the google manifest?
2) Do I need to edit it whenever I add additional control or widget like textView ?
3) Do I need to care about the order of the control or widget of which I add first or later?
4) Do I need to manually add the below or it is self generated?
[assembly: UsesPermission(Manifest.Permission.AccessFineLocation)]
[assembly: UsesPermission(Manifest.Permission.AccessCoarseLocation)]
thanks

Quite a lot of your questions are answered in this page - http://docs.xamarin.com/guides/android/advanced_topics/working_with_androidmanifest.xml
In general, Xamarin auto-generates much of the file for you, using hints in the code like [Activity] attributes.
I recommend you read that document above, experiment a little and then come back here if you have specific questions/problems.

Related

use of : in android (manifest.xml)

<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
what is the use of : in android , I ask this cause it is really hard to search similar questions about symbol online , thank in advance!
This is not Android specific. It is XML specific, which is called "XML namespace".
You can find a definition of android: at the root element of this XML file.
xmlns:android="http://schemas.android.com/apk/res/android"

Add translation to TYPO3 Extension via Typoscript

is there a way to substitute/override the default de.locallang.xlf of the extension via Typoscript? I want to change the text of mindshape_cookie_hint in a way that will survive an update.
If it is a plugin you can override translations in TypoScript via _LOCAL_LANG which is also what mindshape_cookie_hint suggests in its docs, for example:
plugin.tx_myext_pi1._LOCAL_LANG.de.list_mode_1 = Der erste Modus
This requires you to manage your translation strings in TypoScript though which is far from ideal.
A better and more general solution is registering custom translations via locallangXMLOverride. This allows you to manage these translations just like everywhere else.
From the documentation:
ext_localconf.php:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['EXT:cms/locallang_tca.xlf'][] =
'EXT:examples/Resources/Private/Language/custom.xlf';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']
['de']['EXT:news/Resources/Private/Language/locallang_modadministration.xlf'][] = 'EXT:examples/Resources/Private/Language/Overrides/de.locallang_modadministration.xlf';
The first line shows how to override a file in the default language, the second how to override a German ("de") translation. The German language file looks like this:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2013-03-09T18:44:59Z" product-name="examples">
<header/>
<body>
<trans-unit id="pages.title_formlabel" xml:space="preserve">
<source>Most important tile</source>
<target>Wichtigster Titel</target>
</trans-unit>
</body>
</file>
</xliff>
You are looking for this https://wiki.typo3.org/TypoScript_language_additions,_override
As written by Ghanshyam Bhava in his answer, you can just take a look at
the locallang.xlf file in the plugin folder in the file system to have an overview of the keys the extension uses and then write in your TypoScript template:
plugin.tx_exampleplugin_pi1._LOCAL_LANG.it {
key1 = value1
key2 = value2
...
}
see also https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Plugin/Index.html#local-lang-lang-key-label-key
In a general way, correct me if I am wrong, I think that you have modified the original .xlf file of the plugin; this procedure is not recommended for the reason you are facing: an update would delete your changes.
A good way to deal with this problem could be for example using the extension EXT:lfeditor (https://extensions.typo3.org/extension/lfeditor/); read carefully its manual.
Another source (official documentation): https://docs.typo3.org/typo3cms/CoreApiReference/latest/ApiOverview/Internationalization/ManagingTranslations.html?highlight=locallangxmloverride#custom-translations
I'll take an excerpt from that page:
The $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride'] allows to override both locallang-XML and XLIFF files. Actually this is not just about translations. Default language files can also be overridden. In the case of XLIFF files, the syntax is as follows (to be placed in an extension's ext_localconf.php file):
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['EXT:cms/locallang_tca.xlf'][] = 'EXT:examples/Resources/Private/Language/custom.xlf';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['de']['EXT:news/Resources/Private/Language/locallang_modadministration.xlf'][] = 'EXT:examples/Resources/Private/Language/Overrides/de.locallang_modadministration.xlf';
The first line shows how to override a file in the default language, the second how to override a German ("de") translation. The German language file looks like this:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2013-03-09T18:44:59Z" product-name="examples">
<header/>
<body>
<trans-unit id="pages.title_formlabel" xml:space="preserve">
<source>Most important tile</source>
<target>Wichtigster Titel</target>
</trans-unit>
</body>
</file>
</xliff>
With below typoscript you can overwrite individual translations for TYPO3 Extension:
plugin.tx_myPlugin_pi1._LOCAL_LANG.de.key = value;
plugin.tx_myPlugin_pi1._LOCAL_LANG.en.key = value;
Generally common for every extension. Hope this will help you!
Greetings!

NLog internal log not working with ASP.Net MVC

I have a problem with NLog for logging its internal logs with this configuration
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
throwExceptions="true"
internalLogFile="${basedir}/App_Data/NLog.log"
internalLogLevel="Trace">
<targets>
<target name="debug"
xsi:type="File"
fileName="${basedir}/App_Data/Site.log" />
</targets>
<rules>
<logger name="*"
writeTo="debug" />
</rules>
</nlog>
The target "debug" is working well, but the internalLogFile is only working if I set it for exemple to "D:/NLog.log".
Any idea why this happening?
You can't use layout renderers ${...} in the internalLogFile property. They are for a target's layout only:
<target layout="${...}" />
Try to use relative path like "..\App_Data\NLog.log"
Update NLog 4.6 enables some simple layouts.
The internalLogFile attribute needs to be set to an absolute path and the executing assembly needs to have permission to write to that absolute path.
The following worked for me.
Create a folder somewhere - e.g. the route of your c: drive, e.g. c:\logs
Edit the permissions of this folder and give full control to everyone
Set your nlog config: internalLogFile="C:\logs\nlog.txt"
Remember to clean up after yourself and not leave a directory with those sorts of permissions on
NLog ver. 4.6 add support for environment-variables like %appdata% or %HOME%, and using these basic layouts in internalLogFile=:
${currentdir}
${basedir}
${tempdir}
NLog ver. 4.7 also adds this:
${processdir}
See also: https://github.com/NLog/NLog/wiki/Internal-Logging
from this link I think the path is absolute

problems with setting up wsit-client for metro webservice call

This might be a pretty basic issue but I feel like I'm way over my head with it. I created a client side web service java object using the customer provided wdsl (wsimport). the problem is that they are saying I need to include a security header so it will connect. the header is not in the WSDL. I did some research into this and it seems that I need to import a wsit-client.xml into it when I do the wsimport. I can't seem to find a clear example of this file. I have tried to piece one together from the example I have found but when I run wsimport it never seems to pick it up. here is what I have:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecurity" name="SecurityService"
xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecurity"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wspp="http://java.sun.com/xml/ns/wsit/policy"
xmlns:sc="http://schemas.sun.com/2006/03/wss/server"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<portType name="LOOKUP_PortType"/>
<binding name="LOOKUP_Binding" type="tns:LOOKUP_PortType">
<wsp:PolicyReference URI="#lookupSecurityPolicy"/>
</binding>
<service name="XXSW_GPOS_CUSTOMER_CREDIT_PKG_Service">
<port name="XXSW_GPOS_CUSTOMER_CREDIT_PKG_Port" binding="tns:LOOKUP_Binding"/>
</service>
<wsp:Policy wsu:Id="lookupSecurityPolicy">
<wsp:ExactlyOne>
<wsp:All>
<sc:CallbackHandlerConfiguration wspp:visibility="private">
<sc:CallbackHandler name="usernameHandler" default="username" />
<sc:CallbackHandler name="passwordHandler" default="password" />
</sc:CallbackHandlerConfiguration>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</definitions>
the XML isn't malformed but I know I'm missing something or completely have the whole idea of this wrong. I really need a good walk through of how to create this but I can't seem to find one on the net. any help would be very appreciated.
wsit-client.xml is not used by wsimport. You put in in /META-INF/ and Metro reads it when you connect to the service.

WebSphere 6.1 Change Class loader order

I want to change the class loader delegation order on a web module deployed to WAS6.1 from it's default of parent first to parent last. The reason is I would like to use JSF 1.2 etc and WAS6.1 doesn't normally support it.
In the integrated solutions console for the locally deployed instance, under Enterprise Applications > MyAppEAR > Manage Modules > MyApp.war the Class loader order drop down is greyed out.
Why is it greyed out?
How can I ungrey it out?
Would it be better to put a directive in the deployment descriptor?
If the answer to (3) is anything other than No, please can you specify exactly the code to do this.
I can't for the life of me find the answers to these questions on the web.
I had the same thing. I needed to set the classloader to PARENT_LAST but the setting was greyed out. I 'solved' it by manually putting a deployment.xml file (contents below) in META-INF/ibmconfig/cells/defaultCell/applications/defaultApp/deployments/defaultApp of your ear project.
<?xml version="1.0" encoding="UTF-8"?>
<appdeployment:Deployment xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:appdeployment="http://www.ibm.com/websphere/appserver/schemas/5.0/appdeployment.xmi" xmi:id="Deployment_1212499072929">
<deployedObject xmi:type="appdeployment:ApplicationDeployment" xmi:id="ApplicationDeployment_1212499072929" startingWeight="10">
<modules xmi:type="appdeployment:WebModuleDeployment" xmi:id="WebModuleDeployment_1212499072929" startingWeight="10000" uri="yourwarproject.war" classloaderMode="PARENT_LAST"/>
<classloader xmi:id="Classloader_1212499072929" mode="PARENT_LAST"/>
</deployedObject>
</appdeployment:Deployment>
Hope this helps.
I had the same problem!
I needed to change:
enable reload of classes: reloadEnabled="true"
update interval: ??? (still searching, any help appreciated)
here my deployment xml file:
<?xml version="1.0" encoding="UTF-8"?>
<appdeployment:Deployment xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:appdeployment="http://www.ibm.com/websphere/appserver/schemas/5.0/appdeployment.xmi" xmi:id="Deployment_1310499119656">
<deployedObject xmi:type="appdeployment:ApplicationDeployment" xmi:id="ApplicationDeployment_1310499119656" startingWeight="10" warClassLoaderPolicy="SINGLE" reloadEnabled="true">
<modules xmi:type="appdeployment:WebModuleDeployment" xmi:id="WebModuleDeployment_1310499119656" startingWeight="10000" uri="tcm_portal_web_six.war" classloaderMode="PARENT_LAST"/>
<modules xmi:type="appdeployment:WebModuleDeployment" xmi:id="WebModuleDeployment_1310499119657" startingWeight="10000" uri="tcm_portal_lib.war" classloaderMode="PARENT_LAST"/>
<classloader xmi:id="Classloader_1310499119656" mode="PARENT_LAST"/>
</deployedObject>
</appdeployment:Deployment>
BR
Dirk

Resources