is it possible to get live audio stream from mobile mic with specified PCM format, so that I can use that stream in a socket connection.
How to get live/continious audio stream from mobile microphone
How to write logs to file?
I am building my project using .NET Standard. Is there any way to write logs to file in Xamarin?
Round Stacklayout OneSide(Left Top and Left Bottom)
Hello Delveloperd,
I want to implement only one side round stacklayout (Left Top and Left Bottom).
It's posible in xamarin forms and blow i upload a image for example like this.
any guid for this
Thanks
Deepak
Error MT2002
Xamarin Forms project, visual studio 2017 15.9.4. I compile a project with connection to macbook.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(795,3): error MT2002: Can not resolve reference: /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Facades/System.Resources.Reader.dll
Unable to build after upgrading to Xamarin.Forms 3.4 or 4.0 from 3.3
Hi Guys, hope you can help because this is driving me nuts.
After updating Xamarin Froms to either 3.4 or 4.0, I get a build error for every XAML file.
If I upgrade to 3.4 then the error is:
Valu cannot be null, parameter name method
If 4.0 then it varies between:
Type Color not found in xmlns xamarin. com/schemas/2014/forms
Type Binding not found in xmlns xamarin. com/schemas/2014/forms
Type StaticResource not found in xmlns xamarin. com/schemas/2014/forms
Type RowDefinition not found in xmlns xamarin .com/schemas/2014/forms
I have killed bin and obj directories, cleared nuget cache, turned everything on and off again.
Also tried in Visual Studio 2017 (15.9) & 2019 and the same happens
Unable to get circle image in plugin?
I need to get a circle button. but circle image does not comes. Only square image comes please help. I'm using this plugin
https://github.com/wilsonvargas/ButtonCirclePlugin
Please advise
Attached image and code
<!--
Hide a specific child page of a CarouselPage
Hi Guys,
I need a way to hide a specific carousel page. I do not want to remove the page as a whole because then I would lose all the changes made on that particular page which I want to maintain like Field changes, Scroll position, control states and so on. Possible? I dont mind using TabbedPage is this feature is only possible on that.
Thanks.
How to detect if the device "notch", the model or the height of the screen (from shared code)?
I want to put a margin / padding top if the device is iOS and has notch.
And I want to do it from the generic code not using the specific iOS project.
I've been looking for a lot and I think I can not check if it has notch and not know if it's an iPhone X, so...
- I can not know the model of the device
- I can not know if the device has notch
- Can I know the height and orientation of the device?
If possible I could do the following:
if (
(Device.RuntimePlatform == Device.iOS) // Ok
&& (check orientation == portrait)
&& (check height device == XXXX)
){
Padding = new Thickness(0, 20, 0, 0);
}
How to solve the below issue which i am getting while writing UI tests
This is a simple UI test which I have created for a Xamarin.Forms application and I am getting this error while running tests.
Let me know how to solve this issue.
XAML Learning Curve
Hi everyone,
Most of the time, I am developing apps using Xamarin.iOS and I am comfortable with it. But this time, I got one more job that requires the same app for Android version. Since I have no knowledge of XAML, I thought that it is better to start with Xamarin.iOS and then developing the app with Xamarin.Android.
I need to develop the app in 3 months for both iOS and Android version.
What are your experience for learning XAML? Do you think it is better to focus on Xamarin.Forms rather than Xamarin.Native? or should I stick with what I am comfortable with because of time limitation?
Thank you very much!
Google Drive Rest API
Hi, I am trying to implement a feature in my app where the user logs in on their Google account and can upload/download to their Drive.
I have a functioning solution using Android.Gms.Drive, and Android.Gms.Auth.Api.SignIn, but, unsurprisingly this only works for android and with the deprication of Google Drive Android API, this will need to be migrated to the rest api anyway.
The question I have is, are there any good tutorials for implementing this? The one I find aren't intended for Xamarin, along with the fact that I am uncertain which libraries are best for the situation.
Any suggestions are appreciated.
Thank you for your time and assistance.
NFC Reader for iOS11 App
Hello,
Now that Apple has exposed the NFC APIs for the app development and we can create iOS 11 apps to read/write NFC tags, we wanted to create an iOS App (using Xamarin forms or native iOS using .net) for the same. So just wanted to know if there are any updates to Xamarin Forms that would allow us to create the app.
Source Reference for binding in a standalone resource dictionary to the a content page context
What should the binding source reference for be in a Xamarin forms 3 standalone resource dictionary? Given the following XAML:
<DataTemplate x:Key="newAddressTemplate">
<ViewCell>
<ViewCell.View>
<Label TextColor="{Binding LabelColorName}" Text="{Binding Label}" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Path=BindingContext.NewAddressCommand, Source={x:Reference Page}}" CommandParameter="{Binding AddressDestinationType}" />
</Label.GestureRecognizers>
</Label>
</ViewCell.View>
</ViewCell>
</DataTemplate>
The TapGestureRecognizer Command binding works if the resource dictionary is in the content page itself (where the content page includes x:Name="Page"), but not when it is moved to a standalone file containing only the resource dictionary. Adding x:Name="Page" to the resource dictionary tag doesn't resolve the issue. It seems like the reference should be to parent whatever that might be.
How to add checkbox in xamarin.forms?
I am wondering how to do that with full functionalities.
I have created that thanks to this answer but I couldn't handle the check/uncheck events so how to handle that?
How to set binding context with Source={x:reference view } in ResourceDictionary
Hello,
I did a post on Stackoverflow, but did not receive any answer. That's why I'm doing this post here, perhaps someone could help me.
Thank you.
XamarinForms APK won't install
We have two apps which are deployed using HockeyApp (Ad Hoc deployment).
After recent updates on my Mac (iOS & Visual Studio Community) I can't install them on Android devices (deployment to iOS devices steill works fine).
I have a message "App not installed".
It is the same when I try to install from APK file on the device (signed or unsigned apk).
I can install the app on the phone in Release mode when I have it connected to the Mac.
I'm not sure what else I should check to investigate this issue?
Visual Studio Community version 7.6.1 (build 9)
iOS version 10.13.16
HockeyApp.SDK.Xamarin 5.1.2
Xamarin.Forms 3.1.0.697729
How to add padding to SearchBar inside Horizontal StackLayout?
For some purpose I want to position SearchBar inside StackLayout whose Orientation is Horizontal and add padding to that StackLayout but I found that the SearchBar takes all the Width space as shown in second SearchBar while when the Orientation is Vertical it works normally as shown in first SearchBar the below image:
Here is the code for both StackLayouts:
<StackLayout Orientation="Vertical" Padding="100,0,100,0">
<SearchBar/>
</StackLayout>
<StackLayout Orientation="Horizontal" Padding="100,0,100,0">
<SearchBar/>
</StackLayout>
I also tried to put the Horizontal-Orientated StackLayout into a Vertcal-Orientated StackLayout as shown in code below:
<StackLayout Orientation="Vertical" Padding="100,0,100,0">
<StackLayout Orientation="Horizontal">
<SearchBar/>
</StackLayout>
</StackLayout>
But it does not help too, So how to solve that problem?
Add a reference to assembly
Hi to all,
I want to add Xlabs to my project, so I read how to implement it ( https://github.com/XLabs/Xamarin-Forms-Labs/wiki ).
I found this problem:
when I try to add this code to "App.cs" in my WinPhone 8.1 project
var app = new XFormsAppWP();
app.Init(this);
on "Init" (app.Init(this)) I had this problem:
The type 'Application' is defined in an assembly that is not referenced.
You must add a reference to assembly 'System.Windows, Version=2.0.6.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'
I have a "Quick Fix" option -> Add a reference to assembly 'System.Windows, Version=2.0.6.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e', but when I try to click on it, nothing happens.
In "Reference Manager" (WinPhone project -> Right click -> Add reference) I can't add this reference because I can't found it.
I using Visual Studio 2015 pro, Xamarin.Forms PCL.
My project targeting .NET 4.5 (I tried also with 4.5.2 but I had the same problem).
How can I resolve this problem?
Navigation via popasync after saving data
I am using MVVM view model to save data. A view model command gets invoked when the user saves the data after clicking on the Toolbaritem button "Save". After saving the data I want to return to the previous page. I could always invoke popasync in the clicked event from the code behind however, that would require the saving to be done in the code behind instead of the view model which is a bad practice as the view should not be aware of any data related aspects. On the other hand I don't want to invoke popasync in view model as it will mean the view model should have knowledge of the views and navigation which is again a bad practice? Whats the best design pattern to achieve this? Is it possible to invoke both the command and clicked event on the same button?
Fix black screen after splashscreen in Android using Xamarin Forms
I have a little problem, the splashscreen is loaded fine but, after that appear a black screen until the app is loaded.
I was seaching for days but and I can't find a solution,
Is someone have a solution for this?
I follow this instructions to get a splashsreen centered:
MainActivity.cs
[Activity(Label = "AppName",
Icon = "@mipmap/icon",
Theme = "@style/MainTheme",
MainLauncher = false,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
[IntentFilter(new[] { Intent.ActionView },
Categories = new[] {
Intent.ActionView,
Intent.CategoryDefault,
Intent.CategoryBrowsable
},
DataScheme = "https://waze.com/ul")
]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
static readonly string TAG = "X:" + typeof(MainActivity).Name;
protected override void OnCreate(Bundle bundle)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
base.OnCreate(bundle);
global::Xamarin.Forms.Forms.Init(this, bundle);
Rg.Plugins.Popup.Popup.Init(this, bundle);
Xamarin.FormsMaps.Init(this, bundle);
AndroidAppLinks.Init(this); //enlace profundo
LoadApplication(new App());
if (Intent != null && Intent.DataString != null)
{
try
{
string email = "";
email = Intent.Data.GetQueryParameter("email");
if (email != null && email != "")
{
Xamarin.Forms.MessagingCenter.Send<string, string>("", "AppLaunchedFromDeepLink", email);
}
}
catch (Exception e)
{
//Catch error
Log.Debug(TAG, "Ha ocurrido una excepcion en MainActivity: " +e);
return;
}
}
}
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Permission[] grantResults)
{
PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults);
}
}
SplashActivity.cs
[Activity(Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true)]
public class SplashActivity : AppCompatActivity
{
static readonly string TAG = "X:" + typeof(SplashActivity).Name;
public override void OnCreate(Bundle savedInstanceState, PersistableBundle persistentState)
{
base.OnCreate(savedInstanceState, persistentState);
Log.Debug(TAG, "SplashActivity.OnCreate");
//StartActivity(typeof(MainActivity));
}
// Launches the startup task
protected override void OnResume()
{
base.OnResume();
Task startupWork = new Task(() => { SimulateStartup(); });
startupWork.Start();
}
// Simulates background work that happens behind the splash screen
async void SimulateStartup()
{
Log.Debug(TAG, "Performing some startup work that takes a bit of time.");
await Task.Delay(1000); // Simulate a bit of startup work.
Log.Debug(TAG, "Startup work is finished - starting MainActivity.");
StartActivity(new Intent(Application.Context, typeof(MainActivity)));
//Finish();
}
}
styles.axml
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MainTheme" parent="MainTheme.Base">
</style>
<style name="MyTheme.Splash" parent ="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>
<!-- Base theme applied no matter what API -->
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
<item name="windowNoTitle">true</item>
<!--We will be using the toolbar so no need to show ActionBar-->
<item name="windowActionBar">false</item>
<!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette -->
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">#901D3E</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">#7c1231</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">#901D3E</item>
<!-- You can also set colorControlNormal, colorControlActivated
colorControlHighlight and colorSwitchThumbNormal. -->
<item name="windowActionModeOverlay">true</item>
<item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
</style>
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">#901D3E</item>
</style>
</resources>
splash_screen.axml
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MainTheme" parent="MainTheme.Base">
</style>
<style name="MyTheme.Splash" parent ="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>
<!-- Base theme applied no matter what API -->
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
<item name="windowNoTitle">true</item>
<!--We will be using the toolbar so no need to show ActionBar-->
<item name="windowActionBar">false</item>
<!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette -->
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">#901D3E</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">#7c1231</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">#901D3E</item>
<!-- You can also set colorControlNormal, colorControlActivated
colorControlHighlight and colorSwitchThumbNormal. -->
<item name="windowActionModeOverlay">true</item>
<item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
</style>
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">#901D3E</item>
</style>
</resources>
I know that if I follow this video, I can get a successful splashscreen (using only a image like a splashscreen) without black screen, but when the orientation is change, the image is it distorts.
Thanks in advances.