I want to create a label that when onclicked it will call a method. Is this possible?
Reading about using ICommand, but it seems limited to TextCell/ImageCell, Button and Toolbar Item.
I want to create a label that when onclicked it will call a method. Is this possible?
Reading about using ICommand, but it seems limited to TextCell/ImageCell, Button and Toolbar Item.
Hi!
So I created a new Xamarin.Forms solution including a Xamarin.Android project. I got the Xamarin Live Player for Android and I managed to pair my device, a Samsung Galaxy S7 with the Visual Studio 2017 Community running on my Windows 10 Pro computer. Fair enough! I clicked the play button from the debug target drop-down list and it was built and deployed to my Android device over the LAN.
Now here is my problem! I closed Visual Studio and downloaded the BugSweeper sample. I unpacked the sample, loaded it up in Visual Studio and selected Windows 10 version 16299 as target framework as the solution contains a UWP project, and my computer is running 16299 version. I set the Android project as the startup project, started the Xamarin Live Player on my device, and selected Manage Xamarin Live Player Devices from the drop-down menu. My device was listed, but it was "unreachable". I tried to remove it by clicking on the X and pair it again.
On my device I got the message "Connected to Visual Studio" and then it changed to "Lost connection to Visual Studio" right thereafter.
Here is the output log.
Start XamariTest.Android, Samsung SM-G930F Player, .
Attempting connection to debug address: 0.0.0.0:37847.
Attempting connection to debug address: 0.0.0.0:37847.
Attempting connection to debug address: 0.0.0.0:37847.
Attempting connection to debug address: 0.0.0.0:37847.
Attempting connection to debug address: 0.0.0.0:37847.
Unable to deploy to Samsung SM-G930F Player, please ensure the Xamarin Live Player app is open and the device is on the same network as Visual Studio.
Failed to debug your app.
Am I doing something wrong here or is the Xamarin Live Player still unstable?
Why is the IP address listed as 0.0.0.0?
It worked the first time, why would it not work each time thereafter?
As can be seen here on the Xamarin Live Player manager window, the device is unreachable.
Hello,
I'm creating an app which is supposed to have a custom camera. What I need is to display some custom text and buttons over the camera preview. I downloaded a sample which works in IOS and also in Android, however, for the Android part, it uses the old Android.Hardware.Camera, so the newer APIs won't run that. I would like to replace the Android renderer's Camera with the newer Camera2, since I'm targeting API 27. Does anybody have an idea on how to do that? I've already done research and tried all sample project I could. Including the official Camera2Basic and Camera2Raw samples...
these is not for a PCL project and I'm not able to "copy" that to my project...
All I could find was either in Xamarin, but not PCL, or written in Java - not usable for me.
PLEASE HELP! Thank you!
I am trying to use an AlertBox in which There will be a title, a message, input field, cancel and okay . I have done some googling and find some code but when I am trying to implement that code I am getting the error on alertdialog.Show();
Unable to add window — token null is not for an application AlertBuilder
here is a snippet of code--
public async Task InputClickedAsync()
{
string Number = "";
try
{
EditText et = new EditText(_context)
{
InputType = Android.Text.InputTypes.NumberFlagDecimal | Android.Text.InputTypes.ClassNumber
};
AlertDialog.Builder builder = new AlertDialog.Builder(_context);
builder.SetTitle("Enter Quantity");
builder.SetPositiveButton("OK", delegate
{
if (!string.IsNullOrEmpty(et.Text))
Number = et.Text;
});
builder.SetNegativeButton("CANCEL", delegate { builder.Dispose(); });
builder.SetView(et);
builder.SetCancelable(false);
AlertDialog alertdialog = builder.Create();
alertdialog.Show();
alertdialog.GetButton((int)DialogButtonType.Positive).Enabled = false;
et.AfterTextChanged += (sender, e) =>
{
if (!string.IsNullOrEmpty(et.Text))
{
alertdialog.GetButton((int)DialogButtonType.Positive).Enabled = true;
}
};
while (string.IsNullOrEmpty(Number))
{
await Task.Delay(25);
}
// return Number;
}
catch (Exception ex)
{
Toast.MakeText(_context, ex.Message, ToastLength.Long).Show();
// ex.Message;
}
}
What to do? Please help
How can I exclude some dlls from apk release build? I need it because I have merged them in one assembly.
Hi,
We are working on a chat app in xamarin ios native app and we want upload a image to server using HttpClient PostAsync() method, but its throw exception like
"System.Net.Http.HttpRequestException: An error occurred while sending the request ---> System.Net.WebException: Error: ConnectFailure (No route to host) ---> System.Net.Sockets.SocketException: No route to host....".
Our code to upload after select a image is..
public async void UploadToServer(string filePath, string filename, string fileExtension,long fileSize)
{
using(var client = new HttpClient())
using(var content= new MultipartFormDataContent())
{
client.BaseAddress = new Uri("http://*////");
var fileContent = new ByteArrayContent(System.IO.File.ReadAllBytes(filePath));
fileContent.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
{
FileName = filePath
};
content.Add(fileContent);
var result= await client.PostAsync("api/FileUpload?groupID =" + ChatDetaiils.groupID + "&memberID=" + UserLogin.userID + "&Message=File Test&chatType=File&FileName="+filename+"&fileSize="+fileSize+"&fileExtension="+fileExtension+"",content);
}
}
We are using same code in our xamarin android native app and its working good in android.
We don't know what was my mistake. We are using visual studio for mac.
Please help to solve this or tell me another method to upload...
How should i enable and disable a button Based on all valid inputs?
And here the validation works good, but not button!!
Thanks in advance!
I created a data template selector and tried to use it in the GroupHeaderTemplate property of a ListView.
It returns the correct template for the item, but after that it throws an System.ArgumentOutOfRangeException (Specified argument was out of the range of valid values. Parameter name: index). I dont know why or where the exception comes from.
However, the template selector works fine if i use it in the ItemTemplate property of the ListView.
Doesn't GroupHeaderTemplate support template selectors?
My template selector is created as shown in the documentation
<ListView HasUnevenRows="True"
ItemsSource="{Binding Assets}"
ItemTemplate="{StaticResource ItemDataTemplate}"
IsGroupingEnabled="True"
GroupHeaderTemplate="{StaticResource AssetHeaderTemplateSelector}">
I have a strange issue.
I use DependencyService to get an instance of a class for Vidyo.
On an emulator the app runs and it gets an instance of the class.
On a device the app crashes - even when inside a try catch.
How can I get more info as to why it is hard crashing?
I need to hide the bottom tab bar when pushing to a new page from a tabbed page.
Any solution?
I have just installed VS 2017 Community with the Xamarin forms add on. I tried to create a test application for Android and iOS but I cannot get it to build even without touching any of the code.
This is the error I am receiving:
_The "Xamarin.Forms.Build.Tasks.GetTasksAbi" task could not be loaded from the assembly C:\Users....nuget\packages\xamarin.forms\3.1.0.583944\build\netstandard2.0\Xamarin.Forms.Build.Tasks.dll. Could not load file or assembly 'file:///C:\Users...nuget\packages\xamarin.forms\3.1.0.583944\build\netstandard2.0\Xamarin.Forms.Build.Tasks.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask
_
I have tried to change the Xamarin.Forms version to a lower version but this gives the same error.
Anyone know how to get this to work?
Hey guys, so i’m new to Xamarin, and really I’m new to programming all around. I worked on Xamarin University for a couple lessons about a month ago. But now that I’m back, after updating all my extensions, the single view starter solution doesn’t build properly. When attempting to access the activity_main.axml file visual studio warns me that "not all the resources compiled successfully" and the designer gives me a "show error".
I’ve updated my android SDK, Downloaded the most recent java JDK and there are no updates availiable. I have no idea where to go from here and I could really just use ideas or solutions. Thanks a ton in advance.
I want end User can reorder the items of the grid view in xamarin forms using Drag & drop.
I have used syncfusion sflistview but unable to implement drag & drop
Please help
I am trying to create a xamarin forms app using VS2017 15.7 which by default adds .NETStandard 2.0 and Xamarin.Forms 3.0 to the shared library.
The default solution doesnt event compile. It only works when i downgrade Xamarin.Forms to 2.5.
Is Xamarin.Forms 3.x even compatible to .NetStandard 2.0?
Hello xamarin world...
How to implement news ticker (run text left to write) in xamarin forms
...Thank You...
Hi All,
I have a following requirement for my Xamarin UI Tests.
Can anyone please let me know how to achieve this scenario?
Does test cloud support Appium to launch the browser and then connect to the Xamarin app?
Hi,
one build run of my Xamarin.Forms project was hangging and i had to close VS2017 with task manager.
From this time on I can not build my project anymore...
Iam getting the Error: CS0006 Metadata file 'C:\Projects\MyApp\MyApp\bin\Debug\MyApp.dll' could not be found
MyApp.UWP CSC 1 Active
And the same for the iOS project...
What Ive tried:
Please help me with this, Ive no Idea how I can fix this
I have suffered the indignity of this bug in VS2017, i have read and applied all the suggestions i found but still not working for me. i have even cleaned my PC and reinstalled VS.
what i see is that *.g.c files not being created
I need help!
Good morning , I would like to help me with a problem , I would want my application asked to leave her to press the button again behind smartphone , I'm looking online but the only thing I find is for android studio and Xamarin use and visual studio 2015 could help me with this problem?