<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"
Related
Research a lot about this issue and found the same question, which doesn't solve my problem. so starting a new question.
Xamarin Android: Android.Views.InflateException - Error when loading Layout
Getting Xamairin forms : Android.Views.InflateException: Timeout exceeded getting exception details when loading layout.
Main.axml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFCDD2"
android:orientation="vertical">
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_name"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/input_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:hint="#string/hint_name" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_email"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/input_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:hint="#string/hint_email" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_password"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/input_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:hint="#string/hint_password" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="#+id/btn_signup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/btn_sign_up"
android:background="#color/colorPrimary"
android:layout_marginTop="40dp"
android:textColor="#android:color/white" />
</LinearLayout>
I have not used layout:width and layout:height properties in my axml and only using an icon having 4kb size.
Please suggest a solution for this issue, thanks in advance...
Getting Xamairin forms : Android.Views.InflateException: Timeout exceeded getting exception details when loading layout.
There are two things needs to be confirmed before using TextInputLayout:
Please make sure, Xamarin.Android.Support.Design lib is correctly referenced in your Xamarin.Android project. If you are using Xamarin.Forms, it should be referenced by default.
Please make sure the Activity is of type Android.Support.V7.App.AppCompatActivity.
If none of the above things help, please provide a basic demo that can reproduce the problem.
Update:
Upon testing on the project you shared. I found you need to use a Theme.AppCompat theme for your activity, you can do that by following below steps:
Create a styles.xml file under Resources\values\ folder with below codes:
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
</style>
</resources>
In MainActivity.cs define the Activity attribute to leverage AppTheme like this:
[Activity(Label = "DinexFeedback", MainLauncher = true, Icon = "#drawable/icon",Theme ="#style/AppTheme")]
public class MainActivity : Android.Support.V7.App.AppCompatActivity
{
...
Then the project will run fine.
Unhandled Exception: Android.Views.InflateException:
Make sure the necessary nuget package installed in visual studio.
I used card view in my project, i got this issue becoz i didn't install Xamarin.Android.Support.cardview.
so we should install all support nuget package in order to support all widgets here i use card view.
click on project -> Manage Nuget-> check out the installed pakages, if the package were not installed just search the particular package and then download it.
updated on 10/12/2018
check your layout whether all the layout fields are started with capital letter. for ex : In android we used in small letter but In c# we should use otherwise it throws the inflate view exception.
I am trying to integrate stripe payment gateway in xamarin.android but I have get application closing issue. Here is the sample code what I have tried.
Sample Code:
[assembly: ExportRenderer(typeof(PaymentView), typeof(CardInputActivity)]
namespace SampleProject.Droid.PaymentController
public class CardInputActivity(Bundle bundle) : Activity
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.CardInput);
Helper.StripeView = FindViewById<StripeView>(Resource.Id.stripeLayoutOne);
}
CardInput.axml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="20dp">
<Stripe.StripeView
android:id="#+id/stripeView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp" />
</LinearLayout>
This is the code I have tried. In above 'CardInPutActivity' is the renderer class in android, 'CardInputView' is the layout file in resource folder and 'PaymentView' is the portable class contain view.
Unfortunately I'm not sure what the answer is. It appears the Xamarin Stripe component is several years old now, and may not work any longer. This component was built by Xamarin themselves[1], so contacting them for help may be your best bet.
Beyond that I'd try to go step-by-step through your application with a debugger and/or add some System.out.println() statements to see where things are falling down.
[1] https://components.xamarin.com/view/stripe
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.
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.
I am looking at android documentation and if I want to use include and merge.
So I opened up eclipse and got it to extract some of the code out and it made in my layout this
<include layout="#layout/progressbar" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
and another file with
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<TextView android:text="Loading..." android:layout_height="wrap_content" android:layout_width="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:id="#+id/lblLoading" android:layout_marginLeft="180dp" android:layout_marginTop="240dp"></TextView>
<ProgressBar android:id="#+id/progBar" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_marginLeft="130dp" android:layout_marginTop="230dp"></ProgressBar>
</merge>
Yet when I try to do this in monodroid I get errors saying it can't find merge and include.
Do you have "warnings as errors" enabled? For code completion, Mono for Android includes an XSD for .axml files, and the XSD doesn't specify <include/> or <merge/>, and thus Visual Studio will generate a warning when those are used. Mono for Android doesn't care about them, though, and passes them through to aapt.
It would be useful if you could provide the exact error message.
try using
<ProgressBar android:progress.....
And continue, its more along the lines of messing around with different options.