TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sajid Hussain
948
514
101.7k
How to initialize bar code scanner on App startup.
Dec 21 2017 12:35 AM
I have a requirement for my xamarin cross platform application that as soon as app start up .QR Scanner set in to read the code. on completing scanning a beep will be ring up.and app again ready for next scanning how can i get this done. what i have done is on button click scanner start, its read code, then i have to press button again to start it again.
public
HomePage()
{
Button scanBtn =
new
Button
{
Text =
"Scan Barcode"
,
HorizontalOptions = LayoutOptions.FillAndExpand,
};
scanBtn.Clicked += async (sender, args) =>
{
var scanResult = await Acr.BarCodes.BarCodes.Instance.Read();
if
(!scanResult.Success)
{
await
this
.DisplayAlert(
"Alert ! "
,
"Sorry ! \n Failed to read the Barcode !"
,
"OK"
);
}
else
{
var endpoint =
new
EndpointAddress(
"http://192.168.15.33/SMS/WebServices/SMSService.svc"
);
var binding =
new
BasicHttpBinding
{
Name =
"basicHttpBinding"
,
MaxBufferSize = 2147483647,
MaxReceivedMessageSize = 2147483647
};
TimeSpan timeout =
new
TimeSpan(0, 0, 30);
binding.SendTimeout = timeout;
binding.OpenTimeout = timeout;
binding.ReceiveTimeout = timeout;
_client =
new
SMSServiceClient(binding, endpoint);
_client.ValidateStudentAsync(
"123-admin"
);
_client.ValidateStudentCompleted += _client_ValidateStudentCompleted; ;
// await this.DisplayAlert("Scan Successful !", String.Format("Barcode Format : {0} \n Barcode Value : {1}", scanResult.Format, scanResult.Code), "OK");
}
};
Content =
new
StackLayout
{
Children = {
scanBtn
}
};
}
Reply
Answers (
1
)
package restore failed
error while running windows mobile application