I want to build Xamarin forms application using Material design , so could any one suggest me the best source to learn Material Design for building Xamarin forms Application.
Source to learn Material Design for building Xamarin forms Application.
Using nightly build to test new FlowDirection property for Globalization
Like several other developers who design apps for right to left written languages, I was happy to see that the Forms roadmap indicates that work on the new FlowDirection is done. I've pulled down two different nightly builds in an effort to test the functionality. While intellisense appears to recognize the new syntax in XAML (I'm using VS2017), and the code builds without issue, when I attempt to deploy a simple
StackLayout Orientation="Horizontal" FlowDirection="RightToLeft" Spacing="0"
Label Text="Welcome to Xamarin.Forms!" VerticalOptions="Center" HorizontalOptions="Center"
StackLayout
I receive an error stating "No property, bindable property, or event found for FlowDirection" Is there a trick to using the nightly builds that I'm not aware of? I'm using Xamarin Live with a device running Android 7.0 API 24 for my testing purposes, if that helps.
Xamarin Forms (Android) How to do the Touch Test
https://edge.alluremedia.com.au/m/g/2014/08/Samsung1.jpg
I would like to do a touch test with Xamarin forms, I made a touch screen with skiasharp, but it's just drawing.
I want to complete the test when the frames on screen are full.
Is it possible to allow the user to write a review in the application and then send it to the store
Hi,
So I've been asked to create a page where the user can enter a review for the application with a textbox for a review and a star rating control.
The design says that if the review is positive, I ask the user if he wants to share it on the PlayStore / App Store. I don't even know if that's possible. I would rather just ask the user if he likes the application and then redirect him to the store, but they would rather he types in the review in the application and then we send it over to the store.
How can I do that? I suspect it's either not possible or if it is, the user still needs to do the final action of accepting the review on the store page. Otherwise, if there was a method to send a review for the user why wouldn't some apps just create positive reviews and send them on the users behalf without their knowledge.
I know I can link to the App Store as a sort of "review my app link" or that with iOS I can ask for a store review popup but is it possible to pre-populate the review info in the app?
Why I cannot run project that has been created with Windows on Mac?
I always develop my project on my desktop, which has windows installed. I am going to have a presentation, and my laptop is a mac. I am trying to get the same code run on that mac. So, I copied the whole project folder to that mac, but I cannot even build any solution for that project. I intuitively thought it should possible and easy. Now, when I click "rebuild all" I got error message
"your project is not referencing the "monoandroid,version=v7.1" framework. add a reference to "monoandroid,version=v7.1" in the "frameworks" section of your project.json, and then re-run nuget restore"
Xamarin Forms app with specific file-types
I researched and found materials that tell me how to handle an application with specific file types.
I'm trying now to open my application when clicking on my file in the manager. It's working on Android 4.4, for example, but version 7.0 did not work.
When I searched, I found this explanation, from official Android 7.0 Changes:
For apps targeting Android 7.0, the Android framework enforces the StrictMode API policy that prohibits exposing file:// URIs outside your app. If an intent containing a file URI leaves your app, the app fails with a FileUriExposedException exception.
To share files between applications, you should send a content:// URI and grant a temporary access permission on the URI. The easiest way to grant this permission is by using the FileProvider class. For more information on permissions and sharing files, see Sharing Files.
I understand that it only accepts mime type, and it is not possible to use specific types.
Is that correct? Can not we open a custom file anymore? If yes, what alternative can I adopt?
Thanks!
Custom Pin
How to create a pin like in the image and inside the pin there is a uri image loaded ?!
Switch control throws Java.Lang.NullPointerException
Hi guys.
I want to add switch control to XAML:
<Switch IsToggled="{Binding IsAdult}" />
Here is my XAML file (I
<ContentPage.Content>
<StackLayout Orientation="Horizontal" HorizontalOptions="Center">
<Image
Source="nick_icon.png"
WidthRequest="30"
HeightRequest="30" />
<Entry
Placeholder="Nazwa użytkownika"
FontSize="Default"/>
</StackLayout>
<StackLayout Orientation="Horizontal" HorizontalOptions="Center">
<Label Text="Jestem osobą pełnoletnią"/>
<Switch IsToggled="{Binding IsAdult}" />
</StackLayout>
<customs:RoundedSendButton
HorizontalOptions="Center"
Text="SIGN UP"
TextColor="White"
BackgroundColor="#f3b197"
Margin="20, 0">
</customs:RoundedSendButton>
</StackLayout>
</ScrollView>
</ContentPage.Content>
I inject ViewModel which works. When I run this in Android Emulator on Windows then I get:
Java.Lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference
I also tried:
<ContentPage.Content><Switch IsToggled="{Binding IsAdult}" /></ContentPage.Content>
So, the problem is related with . I tried to find something on the Internet, but I've not found a solution.
Do you know how to resolve it?
How to listen to Clipboard copy when App is in background
I want to listen to any copy activity to clipboard when app is onPause(), Then retrieve the word copied in an Entry field. I tried this but app crashes when I put it in the background:
in the App.xaml.cs class ..onPause() calling RegPrimaryClipChanged() method :
public partial class App : Application
{
static bool bHasClipChangedListener = false;
ClipboardManager ClipBoardManager = (ClipboardManager) Forms.Context.GetSystemService(Context.ClipboardService);
public App()
{
InitializeComponent();
MainPage = new Translator.MainPage();
}
static bool bHasClipChangedListener = false;
ClipboardManager ClipBoardManager = (ClipboardManager) Forms.Context.GetSystemService(Context.ClipboardService);
protected override void OnSleep()
{
// Handle when your app sleeps
base.OnSleep();
RegPrimaryClipChanged();
}
private void RegPrimaryClipChanged()
{
if (!bHasClipChangedListener)
{
ClipBoardManager.AddPrimaryClipChangedListener(new OnPrimaryClipChangedListener());
bHasClipChangedListener = true;
}
public class OnPrimaryClipChangedListener : Java.Lang.Object, ClipboardManager.IOnPrimaryClipChangedListener
{
ClipboardManager myClipBoard;
public void onPrimaryClipChanged()
{
ClipData clipData = myClipBoard.PrimaryClip;
//Toast.MakeText(Application.Current, 1, ToastLength.Short).Show();
ClipData.Item item = clipData.GetItemAt(0);
Translator.MainPage.likecount.Text = item.Text;
}
public void OnPrimaryClipChanged()
{
throw new NotImplementedException();
}
}
Show softkeyboard when bluetooth keyboard is connected
Currently, i'm working on my first project with Xamarin forms and android. I have a bluetooth barcode scanner paired with android device. So softkeyboard doesn't appear when it's connected. I tried many options what i found in the internet. Such as forced softkeyboard call from CustomEntryRenderer and other places. In some cases it's possible to handle in Language/InputMethods menu in Android, but not in all phones. Maybe i'm missing something, and called code from wrong place. The question is how to show softkeyboard, even when bluetooth keyboard is connected?
public void ShowKeyboard()
{
this.Control.RequestFocus();
InputMethodManager inputMethodManager = this.Control.Context.GetSystemService(Context.InputMethodService) as InputMethodManager;
inputMethodManager.ShowSoftInput(this.Control, ShowFlags.Forced);
inputMethodManager.ToggleSoftInput(ShowFlags.Forced, HideSoftInputFlags.ImplicitOnly);
}
protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
if (Control == null) return;
if (e.PropertyName == ExtendedEntry.IsBorderErrorVisibleProperty.PropertyName)
UpdateBorders();
if (((ExtendedEntry)this.Element).IsFocused)
ShowKeyboard();
}
Xamarin.Forms Nuget package latest stable 2.5.1.444934
Question:
With all the resources available to Xamarin and the amount of testing that OUGHT to be done, why is it that a new stable release breaks every app project it is applied to? WHY?
If you're going to put out a new nugget release, MAKE SURE IT WORKS!
I can't even rollback gracefully without uninstalling a ton of dependencies first THEN reinstalling the LAST version that worked 2.5.0.280555 THEN reinstalling all the dependent plugins.
Just incredible!
WOW!
How to display the List of Folders and Files from Internal Memory into Listview in Xamarin Forms?
I want to show the list of folders,sub folders and files from internal memory into listview in xamarin Forms C#
How to change Entry border in Xamarin.Forms?
Hi All,
(Low Resolution Device Image)
(High resolution device image)
High Resoluiton device images
I want to show Entry control with Rounded Border (Refer Low Resolution device image) in High Resolution device.
Anyone idea how to achieve this scenario in Xamarin.Forms?
Regards,
Srinivasan
Platform specific RowHeight not working in Xamarin.Forms.
I'm defining a list view as follows:
<ListView Grid.Row="0" Grid.Column="1" ItemsSource="{Binding MenuList}"
SelectedItem="{Binding SelectedEngine, Mode=TwoWay}" SeparatorVisibility="None">
<ListView.RowHeight>
<OnPlatform x:TypeArguments="x:Int32">
<On Platform="Android">52</On>
<On Platform="UWP">154</On>
</OnPlatform>
</ListView.RowHeight>
</ListView>
But I get an error message saying:
No property, bindable property, or event found for 'RowHeight', or mismatching type between value and property.
And if I drop the <ListView.RowHeight> out it compiles. Does anyone know how I can fix the issue?
PCLCrypto library
Hello,
I am working on RSA cryptography on Xamarin.Forms, using PCLCrypto library , it gives error when I use "OpenAlgorith" method
var RsaObject = WinRTCrypto.AsymmetricKeyAlgorithmProvider.OpenAlgorithm(AsymmetricAlgorithm.RsaPkcs1);
the error is "PCLCrypto.NotImplementedByReferenceAssemblyException: This is a reference assembly and does not contain implementation. Be sure to install the PCLCrypto package into your application so the platform implementation assembly will be used at runtime."
I searched too much on the internet, but nothing worked with me, any help please.
Brand New Xamarin Forms Project, Visual Studio Crashes if Android is Included
I have the latest VS 2017 (updated today). I tried a new Xamarin Forms project (Cross-Platform > Mobile App (Xamarin.Forms)) which I haven't tried out yet. Whenever I do this and Android is included the projects are created and show up in Solution Explorer but VS is unresponsive and exits after a few seconds. If I launch the newly created solution the same thing happens.
I've tried Shared Project and .NET Standard. Same results.
Xamarin.Forms example code don't deploy into android device emulator
Hi,
I am newbie about xamarin and I need understand why the deploy process take a looong time to move my apk app to emulated device.
I am using
- VS2017 15.6.4
- Xamarin 4.9.0.752
- Xamarin Designer -4.10.58
- Xamarin.Android.SDK 8.2.0.16
- Xamarion.iOS and Xamarin.Mac SDK 11.8.1.28
- XamarinCRM - Android example (Xamarin Forms)
After be waiting for one hour I decided going to the option Build-> Cancel and stop the deploy: This is the output: from build window:
1>C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.3\zipalign.exe 4 "C:\Users\rolando\Downloads\app-crm-master\app-crm-master\src\MobileApp\XamarinCRM.Android\obj\Debug\android\bin\com.xamarin.xamarincrm.apk" "bin\Debug\com.xamarin.xamarincrm-Signed.apk"
1>C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.3\apksigner.BAT sign --ks "C:\Users\rolando\AppData\Local\Xamarin\Mono for Android\debug.keystore" --ks-pass pass:android --ks-key-alias androiddebugkey --key-pass pass:android --min-sdk-version 17 --max-sdk-version 27 bin\Debug\com.xamarin.xamarincrm-Signed.apk
1>Done building project "XamarinCRM.Android.csproj" -- FAILED.
1>
1>Deploy failed on VisualStudio_android-23_arm_phone
1>Process was cancelled
Build has been canceled.
Bindings, bindings, bindings - Its doin' my 'ead in!!
Ive taken a piece of code from the forum and worked it into my project:
var dirName = new Entry()
{
Text = "",
BackgroundColor = Color.White,
TextColor = Color.Black,
HeightRequest = 40,
WidthRequest = 140,
HorizontalOptions = LayoutOptions.FillAndExpand
};
string item = "foo";
dirName.BindingContext = item;
dirName.SetBinding(Entry.TextProperty, ".", BindingMode.TwoWay);
Now, although the string 'foo' appears in the entry 'dirname' when I open the form, changes to that entry do not update the item variable which is really what Im looking for.
Why is that? Any help is greatly appreciated..!
when is OnTrimMemory called in Android?
I had logged event on when OnTrimMemory memory is called in my app and i am seeing this method is called very often. is that something I should worry about? i though first that it is an method called only when memory usage is high and available memory is low but apparently thats not the case. i logged on my own phone to see what is the memory usage and available memory at the time when this method is called and I am seeing that memory usage is in acceptable level and available memory.
DeviceInfo plugin, iOS, and TestFlight?
I am using @JamesMontemagno 's great DeviceInfo plugin to get the device info. It works fine for Android. I get a unique Id (CrossDeviceInfo.Current.Id) for each device whether I deploy it directly or via HockeyApp for testing.
However, I get a different device id for iOS depending on if I have the app running in debug mode through the mac (Xamarin.iOS build host) or TestFlight. Is there any reason why I should be getting a different device id when I have installed this app using TestFlight?
Is there a better method for getting the unique device id? I need the device id to add as a tag to Notification Hub.