I'm building a Xamarin CrossPlatform app all of its database is in cloud api's, but I want a local storage file in mobile which stores all login credentials whenever someone is login.
Kindly help me through this!
I'm building a Xamarin CrossPlatform app all of its database is in cloud api's, but I want a local storage file in mobile which stores all login credentials whenever someone is login.
Kindly help me through this!
Hi,
I want to validate only numbers and decimal point in Xamarin forms. In entry field i kept Keyboard="Numeric"
and in Validation class
public class ValidationBehavior : Behavior
{
//const string passwordRegex = @^[1-9]\d*(.\d+)?$;
protected override void OnAttachedTo(Entry bindable)
{
base.OnAttachedTo(bindable);
bindable.TextChanged += BindableOnTextChanged;
}
protected override void OnDetachingFrom(Entry bindable)
{
base.OnDetachingFrom(bindable);
bindable.TextChanged -= BindableOnTextChanged;
}
private void BindableOnTextChanged(object sender, TextChangedEventArgs e)
{
//var number = e.NewTextValue;
//var numberPattern = "5";
//var entry = sender as Entry;
//if (numberPattern.Contains(number))
//{
// entry.TextColor = Color.Red;
//}
//else if (number == null)
//{
// entry.BackgroundColor = Color.Red;
//}
if (!string.IsNullOrWhiteSpace(e.NewTextValue))
{
bool isValid = e.NewTextValue.ToCharArray().All(x => char.IsDigit(x));
((Entry)sender).Text = isValid ? e.NewTextValue : e.NewTextValue.Remove(e.NewTextValue.Length - 1);
//((Entry)sender).TextColor = isValid ? Color.Default : Color.Red;
}
}
If i use this I cant access decimal.Please help me with this
I am developing the the application for transferring data in offline.I used the IDnsSdTxtRecordListener for sensing the near by device.And implement the function OnDnsSdTxtRecordAvailable,this function is not called some times.I need to get the IP address of the nearby devices.
If anyone have an idea,Please suggest me ,How to solve/Overcome this issue.
Thanks in advance
I had followed the tutorial of getting started in android and use the Embeddinator-4000 to code in C# and build in Android Studio. I met some problems when calling the functions from C# class.
These are the codes
using System;
using System.Collections;
using System.Collections.Generic;
namespace CalculatorLibrary
{
public class TestingCalculator
{
public TestingCalculator()
{
}
public double Addfunction(double value1, double value2)
{
return value1 + value2;
}
public ArrayList ArrayListFunction(string first)
{
ArrayList al = new ArrayList();
al.Add(first);
return al;
}
public int Testing(int value1)
{
return value1;
}
public List<String> List(string first)
{
List<String> List = new List<string>();
return List;
}
public IDictionary<int, object> GetProducts(int departmentID)
{
return new Dictionary<int, object>
{
{ 1, new { Description = "Something" } },
{ 2, new { Description = "Whatever" } },
};
}
public string[] StringArray(string arr)
{
string[] array;
array = new string[3];
return array;
}
public int[] intArray(int a)
{
int[] array;
array = new int[3];
return array;
}
public object objectm(object a)
{
object b = new object();
return b;
}
}
}
After I build the project it would output an aar file. Then I import the aar file into Android Studio.
package com.example.khortsuming.calculatorfinal;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import calculatorlibrary.calculatorlibrary.TestingCalculator;
import md54223a39312377e7a37c3fe640756f5f0.CalculatorActivity;
public class TestingActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_testing);
TestingCalculator testingCal = new TestingCalculator();
testingCal
}
}
When I want to call in Android Studio I only can access
It only passes Addfunction(double) and Testing(int) others could not be seen!
Hello,
I'd like to do something like shown in the attached picture. Do you guys have any suggestions on how I should go about doing it, do I need to write my own control? The drop down and the search bar can be separate components, I just want a dropdown-list to pop.
I go through developer.couchbase.com/mobile/get-started/get-started-mobile/net-mobile/before-you-begin/index.html couchbase documentation. But i am not getting how to use couchbase in Xamarin.Forms PCL project. Can anyone explain how to use in Xamarin.Forms project..
Thanks,
Mahabaleshwar Hegde
Unable to select multiple images from android gallery.
I was able to perform multi select images from iOS using Dependency service, but in android i achieved multiple selection using native code to an extent, but there are certain gallery folders say, FILE MANAGER or SDCard and so on dint support multi selection of images.
Please help.
Hi! I got many "power fail/restart" exceptions on uncertain locations during native debugging. I guess what caused it is that I access sensors data by sensor manager. I can't show my code and I remove my all C++ code won't stop this. Can you tell what cause this exactly? How can I get through this?
Thanks a lot for your helping.
Hi, after capturing the image and setting it on the imageview, the picture being produced is the mirror image of the actual picture. How can I flip it to the actual picture or mirror image the current picture in Xamarin.Android? Any help would be appreciated.
I'm trying to develop a webview app and want to read cookies from the link after login in website. how i can read those cookie in xamarin forms platform. I searching on the web to find any tutorial to read and store cookie from webview but i couldn't find any tutorial. How can i do this on xamarin form pcl project. Thanks you in advance
I'm trying to add Google Pay to my application as described in this tutorial: https://blog.xamarin.com/bring-android-pay-to-your-apps-with-stripe/ and in stripe.com docs - https://stripe.com/docs/mobile/android/google-pay
But when I click to "pay" button, the following message appears: "This payment option is no longer available in this app."
What option is no longer available - wallet?
var options = WalletFragmentOptions.NewBuilder()
.SetEnvironment(WalletConstants.EnvironmentSandbox)
.SetMode(WalletFragmentMode.BuyButton)
.SetTheme(WalletConstants.ThemeLight)
.SetFragmentStyle(new WalletFragmentStyle()
.SetBuyButtonText(BuyButtonText.BuyWithGoogle)
.SetBuyButtonAppearance(BuyButtonAppearance.Classic)
.SetBuyButtonWidth(Dimension.MatchParent))
.Build();
var fragment = SupportWalletFragment.NewInstance(options);
var request = MaskedWalletRequest.NewBuilder()
.SetPaymentMethodTokenizationParameters(
PaymentMethodTokenizationParameters.NewBuilder()
.SetPaymentMethodTokenizationType(PaymentMethodTokenizationType.PaymentGateway)
.AddParameter("gateway", "stripe")
.AddParameter("stripe:publishableKey", "<my_code_here>")
.AddParameter("stripe:version", "2018-11-08")
.Build())
.SetShippingAddressRequired(false)
.SetMerchantName("Xamarin")
.SetPhoneNumberRequired(false)
.SetShippingAddressRequired(false)
.SetEstimatedTotalPrice("10.00")
.SetCurrencyCode("USD")
.Build();
fragment.Initialize(WalletFragmentInitParams.NewBuilder()
.SetMaskedWalletRequest(request)
.SetMaskedWalletRequestCode(111)
.Build());
I have developed a Xamarin Forms(.Net standard) UWP app and submitted it to windows store, but the windows store team reject the app because of the following issue.
The app doesn’t install on one or more of the currently selected device families due to an unsupported minimum OS version. If the affected device family is not intended to be targeted, then please de-select the unsupported device family and resubmit the app. Otherwise, please change the minimum and/or target OS version that the app supports (https://docs.microsoft.com/en-us/windows/uwp/updates-and-versions/choose-a-uwp-version#choose-which-version-to-use-for-your-app)
My apps min and target versions are Windows 10 Fall Creators Update(10.0; Build 16299). I am targetting my app only for windows 10 desktop devices and Windows 10 mobile devices. So what is the correct min and target versions for my app?
Hi Friends,
I want to get current location, when app went into sleep mode or Background.Currently i am using > Plugin.Geolocator.CrossGeolocator.Current
DLL in App OnSleep()
, But Its Working Till Android 8.1 but Android Pie Not updating current Location Values.. How to Achieve in Android Pie?
My Code:
var minute = TimeSpan.FromSeconds(30);
Device.StartTimer(minute, () =>
{
await Task.Run(async () =>
{
TimeSpan t = TimeSpan.FromSeconds(10);
var locator = Plugin.Geolocator.CrossGeolocator.Current;
locator.DesiredAccuracy = 5;
var position = await locator.GetPositionAsync(timeout: t);
//API Method
});
});
Hello All,
I am a beginner in Xamarin and trying to use TabbedPage for my application. When I used TabbedPage and set the icons, it works fine.
Then I set the TabbedPage position to bottom.
However, when I run the application, the TabbedPage icons are not visible and even the width is too long for one Tab
Below is my XAML code:
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="//xamarin.com/schemas/2014/forms"
xmlns:x="//schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:App5.Views"
x:Class="App5.Views.MainPage"
BarBackgroundColor="LightYellow"
BarTextColor="Black"
xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
android:TabbedPage.ToolbarPlacement="Bottom"
android:TabbedPage.BarItemColor="Black"
android:TabbedPage.BarSelectedItemColor="Red">
<TabbedPage.Children>
<NavigationPage Title="Tab1" Icon="Tab1.png">
<x:Arguments>
<views:ItemsPage />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Tab2" Icon="Tab2.png">
<x:Arguments>
<views:AboutPage />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Tab3" Icon="Tab3.png">
<x:Arguments>
<views:AboutPage />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Tab4" Icon="Tab4.png">
<x:Arguments>
<views:AboutPage />
</x:Arguments>
</NavigationPage>
</TabbedPage.Children>
</TabbedPage>
Can anyone please help me on this?
Hi! I got many "power fail/restart" exceptions on uncertain locations during native debugging. I guess what caused it is that I access sensors data by sensor manager. I can't show my code and I remove my all C++ code won't stop this. Can you tell what cause this exactly? How can I get through this?
Thanks a lot for your helping.
I have an app that works fine for the most part. But once it starts having this problem it does not start. I have tried force quitting the app, restarting the ipad. I have to remove and reinstall the app to get it to work again. Here are the device logs for the app. Has anyone encountered this issue before?
Oct 16 16:51:42 ipadapsd(PersistentConnection)[79] : 2017-10-16 16:51:42 -0400 apsd[79]: copyTokenForDomain push.apple.com (null)
Oct 16 16:51:42 ipadmediaserverd(CoreMedia)[24] : -CMSessionMgr- cmsmHandleApplicationStateChange: CMSession: Client com.xxx.yyyy.zzzzz with pid '391' is now Foreground Running. Background entitlement: NO
Oct 16 16:51:42 ipadsharingd[53] : SystemUI unknown identifier: 'com.xxx.yyyy.zzzzz'
Oct 16 16:51:42 ipadsharingd[53] : SystemUI changed: 0x10 -> 0x0
Oct 16 16:51:42 ipadSpringBoard[49] : Dismissing banner for notification (null)
Oct 16 16:51:42 ipadSpringBoard(CoreMotion)[49] : Stopping device motion, mode=0x
Oct 16 16:51:42 ipadAppName[391] : Found new TLS offset at 224
Oct 16 16:51:42 Hillsdale-iPad apsd(PersistentConnection)[79] : 2017-10-16 16:51:42 -0400 apsd[79]: processing 0 incoming low priority messages for com.brightree.hhho.mobile
Oct 16 16:51:42 ipadapsd(PersistentConnection)[79] : 2017-10-16 16:51:42 -0400 apsd[79]: _schedulePendingWorkUpdate
Oct 16 16:51:42 ipadapsd(PersistentConnection)[79] : 2017-10-16 16:51:42 -0400 apsd[79]: flush any pending work that ALS told us to queue for its managed topics {(
)}, processMode userToken
Oct 16 16:51:42 ipadapsd(PersistentConnection)[79] : 2017-10-16 16:51:42 -0400 apsd[79]: received topic update for Normal pretend NO but there is no change.
Oct 16 16:51:42 ipadCommCenter[71] : #I CSIAppInfo.AppObserver: observe_block_invoke: FBSDisplayLayoutUpdateHandler: update start
Oct 16 16:51:42 ipadCommCenter[71] : #I CSIAppInfo.AppObserver: observe_block_invoke: FBSDisplayLayoutUpdateHandler: app (UIApplicationElement 1 hasKeyboardFocus 0)
Oct 16 16:51:43 ipadCommCenter[71] : #I CSIAppInfo.AppObserver: observe_block_invoke: 4. app got notification state: pid=391 for
Oct 16 16:51:43 ipadCommCenter[71] : #I CSIAppInfo.AppObserver: notifyAboutFrontAppChange: notifyAboutFrontAppChange : app: ; pid: 391; net: 0
Oct 16 16:51:43 ipadCommCenter[71] : #I CSIAppInfo.AppObserver: observe_block_invoke: 5. app got notification state: new counter=227
Oct 16 16:51:43 ipadCommCenter[71] : #I BundleID: is a foreground app
Oct 16 16:51:43 ipadsymptomsd(SymptomEvaluator)[109] : 391 com.xxx.yyyy.zzzzz: ForegroundRunning (most elevated: ForegroundRunning)
Oct 16 16:51:43 ipadsymptomsd(SymptomEvaluator)[109] : Entry, display name com.xxx.yyyy.zzzzz uuid 1F817C66-AE2D-3A35-8E0E-A00479640B01 pid 391 isFront 1
Oct 16 16:51:43 ipadsymptomsd(SymptomEvaluator)[109] : Check for bundle name com.xxx.yyyy.zzzzz returns 0
Oct 16 16:51:43 ipadsymptomsd(SymptomEvaluator)[109] : app name com.xxx.yyyy.zzzzz isForeground 1 hasForegroundApps 1, current idea of foreground 0 disp (null)
Oct 16 16:51:43 ipadsymptomsd(SymptomEvaluator)[109] : Going to Foreground, new flags 0x0, initial value 0x0, enabled 0
Oct 16 16:51:43 ipadsymptomsd(SymptomEvaluator)[109] : Continue with bundle name com.xxx.yyyy.zzzzz, is front 1
Oct 16 16:51:43 ipadsymptomsd(SymptomEvaluator)[109] : com.xxx.yyyy.zzzzz: Foreground: true
Oct 16 16:51:43 ipadsymptomsd(SymptomEvaluator)[109] : Set appCompactState object 0 for key com.xxx.yyyy.zzzzz
Oct 16 16:51:43 ipadsymptomsd(SymptomEvaluator)[109] : CFSM2 foreground (current/proposed/state) in = (0/1/2)
Oct 16 16:51:43 ipadsymptomsd(SymptomEvaluator)[109] : CFSM2 foreground (current/state) out = (1/1)
Oct 16 16:51:43 ipadsymptomsd(SymptomEvaluator)[109] : CFSM Current state: idle, changed: systemForeground to 1 for net type 0, eligible for alerted but constraints unsatisfied (1,0,0,0)
Oct 16 16:51:43 ipadsymptomsd(SymptomEvaluator)[109] : CFSM Current state: idle, changed: systemForeground to 1 for net type 0, ineligible for committed as nil pred, wifi (0x0) cell (0x0)
Oct 16 16:51:43 ipadsymptomsd(SymptomEvaluator)[109] : CFSM Relays: cell (active-no/primary-no/knowngood-no/rssithresh-ok/txthresh-ok/arp-ok/dns-ok/tcp-ok/lqm:-2/advisory:0) wifi (active/primary/knowngood/rssithresh-ok/txthresh-ok/arp-ok/dns-ok/tcp-ok/lqm:100/advisory:7)
Oct 16 16:51:43 ipadAppName[391] : Profiling: True
Oct 16 16:51:43 ipadAppName[391] : 10-16-2017 16:51:43:3023 EDT: 1: [Debug] Finished AppDelegate.SetConfigurationManagerDefaults
Oct 16 16:51:43 ipadAppName[391] : Warning: PLCrashReporter has pending crash report
Oct 16 16:51:43 ipadSpringBoard(KeyboardArbiter)[49] : HW kbd: Failed to set (null) as keyboard focus
Oct 16 16:51:43 ipadSpringBoard(FrontBoard)[49] : exited voluntarily.
Oct 16 16:51:43 ipadSpringBoard[49] : Process exited: ->
Oct 16 16:51:43 ipadassertiond[59] : Deleted job with label: UIKitApplication:com.xxx.yyyy.zzzzz[0x7976][59]
Oct 16 16:51:43 ipadassertiond[59] : Submitted job with label: UIKitApplication:com.xxx.yyyy.zzzzz[0x4df4][59]
I have three keys personname,billingdate and nozzolereadings...I am able to work with name and date as it is simple string but nozzolereadings is asking for json object as a value..
My required json request is:
personname name
billingdate 2019-01-01
nozzolereadings [{"opening_reading":"7687","closing_reading":"7691289"},{"opening_reading":"103250","closing_reading":"103348"}]
Anyone suggest please how to send [{"opening_reading":"7687","closing_reading":"7691289"},{"opening_reading":"103250","closing_reading":"103348"}] as value to post request ?This is my code for sending request to API and getting response...
class Bill
{
public async static Task AddBillData(string name,string date)
{
Uri uri = new Uri(urlname);
var postData = new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>("personname",name),
new KeyValuePair<string, string>("billingdate",date),
};
HttpRequestMessage req = new HttpRequestMessage(HttpMethod.Post, uri);
req.Content = new FormUrlEncodedContent(postData);
using (HttpClient client = new HttpClient())
{
var response = await client.SendAsync(req);
var content = await response.Content.ReadAsStringAsync();
statusCheck = JsonConvert.DeserializeObject<StatusView>(content);
}
return statusCheck;
}
}
Hi
I have trouble parsing my JSONstring retrived from my url.
below is my JSONString
php_resp = "{\"customer\":\"turkerler\",\"authority\":\"1023\",\"url\":\"http:\/\/gultekinteknik.com.tr\/file\/TURKERLER-LOGO1.png\",\"message\":\"Welcome\"}"
I need your urgent help guys! Thanks in advance.
Hi,
Well i am knew to Xamarin and confuse of how to parse the JSON object content/array of content into views/component. The purpose of this is that i have a online VPS in the cloud, with MySQL Database there. I put the .php files up and call it using URL to return (in JSON object) the data i query. So, this is what i already know from the web service method:
Please correct me if i am wrong, i am just trying to understand how to get the data into my views (Entry and Label for example). I already know how to request the data and return it, what i am missing is how to parse it and put it into my views. Any help is appreciated
Regards,
Kevin
Hello,
I want to check that in my application is device is in ideal state? means no activity perform in application.So how we can detect?