Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all 204402 articles
Browse latest View live

Getting Started

$
0
0

Hello folks,

I just installed visual Studio Community 2017 Xamarin and downloaded the Pikkart AR SDK.
i plan on doing an android app for 2D objects recognition. (Android 6.0 API23)
So, i followed the instructions here:
https://components.xamarin.com/gettingstarted/pikkartar/true

Modifying the Manifest was easy, but after that it says to add some code in the OnCreate method:
if (Build.Version.SdkInt < BuildVersionCode.M)
{
//you don’t have to do anything, just init your app
InitApp();
}
else
{
CheckPermissions(_permissionCode);
}

The probleme is that there is an errors everywhere:

  • "Build.Version.SdkInt" doesnt exist
  • InitApp(); wasnt there at all, instead i have: SetContentView(Resource.Layout.Main);

I'm new at Android/Xamarin/Pikkart, thats my very first time and i feel quite frustrated to not be able to get done the very first step of any android related things.
If anyone can give me a clue on how to actually get started on the code that really matters, so i can get some results.

My background: 10 years on visual studio 2008 for desktop software development

Thank you

Jeremy


Live player android - Access to path denied

$
0
0

Hi,

I'm trying out the Xamarin Live player on a Oneplus 5 android 7.1 but I get the following error:

Built with 2 messages (1,1): error: Internal Build Error: Access to the path '/data/user/0/com.xamarin.live/files/C/dev/MyCompany/Some-Git/Some/src/SomeDemo/SomeDemo/' is denied. C:\dev\MyCompany\Some-Git\Some\src\SomeDemo\SomeDemo.Android\MainActivity.cs(1,1): error: The type or namespace name 'App' could not be found (are you missing a using directive or an assembly reference?)

Debugging with a USB cable does seem to work and pairing my devices with Visual Studio to.

So anyone some ideas?

Thanks!

Oct 18 - Cape Town - Security in Mobile Applications

Get Navigation bar height in xamarin forms?

$
0
0

I am working on a project where i need to get the navigation bar height.I am getting the whole screen height using:

Helpers.ApplicationContext.ScreenHeight = (int)Resources.DisplayMetrics.HeightPixels / Resources.DisplayMetrics.Density; Helpers.ApplicationContext.ScreenWidth = (int)Resources.DisplayMetrics.WidthPixels / Resources.DisplayMetrics.Density;

But I am not able to get the navigation bar height.

Can any one please suggest an idea to get the navigation bar height of my page.

Thanks in advance.

Navigation Problem : Calling Page disappearing

$
0
0

Hello ,

I have a problem with Navigation/Pages.
I use a MasterDetailPage as Mainpage.
1 )In the app class I set -> MainPage = new NavigationMaster(); //NavigationMaster is from type MasterDetailPage
2) In my MasterDetailPage I set the detail
this.Detail = new NavigationPage(page1);
this.IsPresented = false;
3) in Page1 I call a InputDataPopup which much act as a Modal Dialog Input screen.
await Navigation.PushModalAsync(InputDataPopup);

After I call the 'await PushModalAsync(InputDataPopup)'-Method , my Page1 is dissapearing .
Why ? I did not ask to pop Page1 , why is it popping auotmatically ?

Regards,
Gert

Parse Error

$
0
0

Hi,

Is anyone having APK parse errors? I know the normal reasons but this one seems odd and has started happening recently.

We’ve been building APKs using the Visual Studio Publish APK option for many years now. All of a sudden the app will no longer install on some devices

“parse error there was a problem while parsing the package”

Normally this used to be a problem with the Minimum Target. This is set to Ice Cream Sandwich (15). Xamarin did introduce a bug a year or so back where the Publish tool didn’t sign correctly and when signed only worked on devices with Android 4 or above and we had to use the command line for a while until they fixed it.

This problem seems more bizarre though. The same APK can be installed on a Samsung S6 Edge (Marshmallow) but has a parse error on a normal Samsung S6 also running Marshmallow.

Is this a known problem or is there anything I can do to find out why it’s not installing? I've unpacked the APK and looked at the RSA file and it's using SHA1withRSA version 3.

Any ideas?

DatePicker Crash in Samsung Devices with Andriod 7.0

$
0
0

Hi,

I am getting following error/crash when DatePicker is shown. Its started just after new updates in Samsung having security updates of may 2017.

android.view.InflateException: Binary XML file line #18: Binary XML file line #18: Error inflating class android.widget.DatePicker
Caused by: android.view.InflateException: Binary XML file line #18: Error inflating class android.widget.DatePicker
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.view.LayoutInflater.createView(LayoutInflater.java:645)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:717)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:785)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
at android.app.DatePickerDialog.(DatePickerDialog.java:119)
at android.app.DatePickerDialog.(DatePickerDialog.java:90)

Code:
protected override Dialog OnCreateDialog(int id)
{
if (id == 0)
{
var dailog = new DatePickerDialog(this, HandleDateSet, CutOffDate.Year,CutOffDate.Month - 1, CutOffDate.Day);
dailog.DatePicker.CalendarViewShown = true;
dailog.DatePicker.SpinnersShown = false;

            return dailog;
        }

        return null;
    }

App is compiled for Andriod - 4.4 .
Permission for Read and Write calendar is already assigned.

Thanks
devoas.

Submitting to the Play Store - Google Play App Signing - how to use it?

$
0
0

We're publishing an app to the Play Store for the first time, and have turned on Google Play App Signing.

I've downloaded the App Signing Key and Upload Key, but am struggling to work out what I do with them when doing my final release build.

The Archive tool (in Visual Studio For Mac) asks for a Keystore. Do I need to add the Upload Certificate to a Keystore and use this? The various documents and walk-throughs don't fully describe the process.

Any help would be appreciated!


Android Activity in Xamarin Forms

$
0
0

I work on a Xamarin Forms app where I want to display a PDF in a layout.

For Android I have a library with a class called PdfManager, derived from Java. Lang. object, which encapsulates some Java code.
With this PdfManager you can open and display a PDF.

Is there any way to integrate this pdf view into a Xamarin Forms layout?
Since the PdfManager is not a view class, it probably cannot be integrated using a custom renderer.

How to create a Tabbed page where the main page is no part of the tabbed toolbar?

$
0
0

I want the home screen to be a tabbed page. from the home screen you can go to the tab for settings, for messages, and for photos. But I don't want the home screen to be a tab. I think technically it needs to be a tab. But is there a way to hide its tab in the tab bar? For example, in the tab bar all I see is Settings, Message, Photos.

Thanks

xamarin.forms googlemaps infowindow click open new page

$
0
0

Hello,

in my Xamarin.Forms App I have an Page which indicates an GoogleMap. Everything is working perfect, but when I click on an InfowWindow from a pin, i cant open a new detailpage. The App hangs and I can do nothing with the App. I get no error message.
But its working in iOS.
Heres the Code:

private void MapObjekt_InfoWindowClicked(object sender, InfoWindowClickedEventArgs e)
        {
            App.locator.StopListeningAsync();
            App.locator.PositionChanged -= Locator_PositionChanged;

            objektliste detailPage = new objektliste();
            App.mdp.Detail = detailPage;
        }

Whats my fault ?

Is there a way to update the viewcell (height) once it is rendered?

$
0
0

i am using listview with template selector, one template is for message and one template is for writing new comment. the data template selector works fine. i am using editor for writing new comment because we want multi line comments, which works fine too its height increases if i tap enter button on keyboard.

the only issue which i am facing is the listview Item height, it is not increasing while the editor grows in height and goes outside of the view, next listview item overlaps the editor. Although listview item height refreshes and shows full editor once it goes outside the screen.

i am setting ViewCell height manually and also firing the Grid's InvalidateMeasure() for the grid layout, but nothing helping. Any Ideas?

On android it works fine only facing it on ios.

Testing Xamarin Android and iOS Apps using Appium

$
0
0

Hi,
I need feedback regarding using Appium for testing of Applications using xamarin. I am interested in both Android & iOS app testing though my current focus is Android.

I had tried using Appium for testing Xamarin Android applications few months back. I first tried with their C# SDK, but it looked like the SDK was missing many features and was not on par with the Java SDK.
https://discuss.appium.io/t/c-sharp-net-client-for-appium/1990

Then I tried with the Java SDK too, but some of the sample tests given were themselves failing.
https://discuss.appium.io/t/appium-android-clients-test-cases-failing/2176

Also, they seem to be missing Continuous Integration:
https://discuss.appium.io/t/continuous-integration-in-appium/2182

After that, I just abandoned my search for a test framework temporarily and continued with my application development.

The fact that we can write Cross-Platform test cases in the language of our choice (using various SDKs) sounds very promising. But I am not sure practically, how good is appium, and what have been the changes since my last usage about 7 months back.

@PrabakaranRamasamy , @Prabakaran.Ramasamy , @Stark154 , @Craig_Horsfield , @Madhu2015 , @RussellRowse , @MinZhang ,
I saw your posts about using appium with Xamarin apps. Can you please share your experience with it until now. Which UI test framework and cloud testing service provider are you using currently, & why?

@PrabakaranRamasamy ,
It seems that you have moved to Xamarin.UITest from Appium. Can you please share why and how has been the experience with it? Can we test on local devices & emulators using Xamarin.UITest and if there are any restrictions for it?

Issue in Xamarin web service

$
0
0

Hi, i am new with xamarin, now working on xamarin webservice part. I want to send my username and password to server and server send back some information like userid, applicationid, username etc.

I tried like following:

        Uri requestUri = new Uri("My URL");
        LoginRequest loginRequest = new LoginRequest();
        loginRequest.username = name;
        loginRequest.password = password;
        string jsonData = Newtonsoft.Json.JsonConvert.SerializeObject(loginRequest);
        var objClint = new System.Net.Http.HttpClient();
        System.Net.Http.HttpResponseMessage respon = await objClint.PostAsync(requestUri, new StringContent(jsonData, System.Text.Encoding.UTF8,
         "application/json"));
        string responJsonText = await respon.Content.ReadAsStringAsync();
        Debug.WriteLine("response:>" + responJsonText);

But i got response like this :

         response:>{"userData":null,"verificationStatus":false,"errorDetails":[{"errorMap":{"Error":"Error In Form Data"}}]}

In android studio i am using the same web service and no issue with that. In android studio i am using retrofit library.

    @FormUrlEncoded
    @POST("url")
    Call<LoginResponse> login(@Field("jsonData") String jsonData);

I think issue with this FormUrlEncoded data or the key "jsonData". I am not using any key for jsondata in xamarin. How to add key for jsondata in xamarin?

Anybody please help, thanks in advance.

Android 7.0 System.DllNotFoundException: /system/lib/libsqlite.so

$
0
0

I get this exception System.DllNotFoundException: /system/lib/libsqlite.so whenever I try to create a SQLite.Net.SQLiteConnection in android 7.0
any idea how to fix it?
I'm using these nuget pacakges:

    <packages>
      <package id="ExifLib.PCL" version="1.0.1" targetFramework="monoandroid6" />
      <package id="Microsoft.Bcl" version="1.1.10" targetFramework="monoandroid43" />
      <package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="monoandroid43" />
      <package id="Newtonsoft.Json" version="7.0.1" targetFramework="monoandroid6" />
      <package id="SQLite.Net.Core-PCL" version="3.1.1" targetFramework="monoandroid6" />
      <package id="SQLite.Net-PCL" version="3.1.1" targetFramework="monoandroid6" />
      <package id="SQLiteNetExtensions" version="1.3.0" targetFramework="xamarinios1" />
      <package id="sqlite-net-pcl" version="1.2.1" targetFramework="monoandroid70" />
      <package id="SQLitePCL.bundle_green" version="0.9.3" targetFramework="monoandroid60" />
      <package id="SQLitePCL.plugin.sqlite3.android" version="0.9.3" targetFramework="monoandroid60" />
      <package id="SQLitePCL.raw" version="0.9.3" targetFramework="monoandroid60" />
      <package id="SQLitePCLRaw.bundle_green" version="1.1.1" targetFramework="monoandroid70" />
      <package id="SQLitePCLRaw.core" version="1.1.1" targetFramework="monoandroid70" />
      <package id="SQLitePCLRaw.lib.e_sqlite3.android" version="1.1.1" targetFramework="monoandroid70" />
      <package id="SQLitePCLRaw.provider.e_sqlite3.android" version="1.1.1" targetFramework="monoandroid70" />
      <package id="Xam.Plugins.Settings" version="2.5.1.0" targetFramework="monoandroid60" />
      <package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="23.3.0" targetFramework="monoandroid60" />
      <package id="Xamarin.Android.Support.CustomTabs" version="23.3.0" targetFramework="monoandroid60" />
      <package id="Xamarin.Android.Support.Design" version="23.3.0" targetFramework="monoandroid60" />
      <package id="Xamarin.Android.Support.v4" version="23.3.0" targetFramework="monoandroid60" />
      <package id="Xamarin.Android.Support.v7.AppCompat" version="23.3.0" targetFramework="monoandroid60" />
      <package id="Xamarin.Android.Support.v7.CardView" version="23.3.0" targetFramework="monoandroid60" />
      <package id="Xamarin.Android.Support.v7.MediaRouter" version="23.3.0" targetFramework="monoandroid60" />
      <package id="Xamarin.Android.Support.v7.RecyclerView" version="23.3.0" targetFramework="monoandroid60" />
      <package id="Xamarin.Android.Support.Vector.Drawable" version="23.3.0" targetFramework="monoandroid60" />
      <package id="Xamarin.FFImageLoading" version="2.2.5" targetFramework="monoandroid70" />
      <package id="Xamarin.FFImageLoading.Forms" version="2.2.5" targetFramework="monoandroid70" />
      <package id="Xamarin.Forms" version="2.3.3.168" targetFramework="monoandroid70" />
      <package id="Xamarin.GooglePlayServices.Ads" version="29.0.0.1" targetFramework="monoandroid60" />
      <package id="Xamarin.GooglePlayServices.Analytics" version="29.0.0.1" targetFramework="monoandroid60" />
      <package id="Xamarin.GooglePlayServices.AppIndexing" version="29.0.0.1" targetFramework="monoandroid60" />
      <package id="Xamarin.GooglePlayServices.Base" version="29.0.0.1" targetFramework="monoandroid60" />
      <package id="Xamarin.GooglePlayServices.Basement" version="29.0.0.1" targetFramework="monoandroid60" />
      <package id="Xamarin.Insights" version="1.12.3" targetFramework="monoandroid60" />
    </packages>

CarouselView as a Control

$
0
0

Hello,
i have put Alex's Carrousel in an other xaml file, and tried to include it in my main page but it doesn't seem to work, i tried that with Label it works here is a simple code to show the issue :

MyView.xaml
<br /> <?xml version="1.0" encoding="UTF-8"?><br /> <StackLayout xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:controls="clr-namespace:CarouselView.FormsPlugin.Abstractions;assembly=CarouselView.FormsPlugin.Abstractions" x:Class="SampleApp.MyView" HorizontalOptions="StartAndExpand" VerticalOptions="StartAndExpand"></p> <pre><code><controls:CarouselViewControl Orientation="Horizontal" x:Name="myCarouselView" InterPageSpacing="10" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"> <controls:CarouselViewControl.ItemTemplate> <DataTemplate> <StackLayout HorizontalOptions="StartAndExpand" VerticalOptions="StartAndExpand" BackgroundColor="Aqua" ></StackLayout> </DataTemplate> </controls:CarouselViewControl.ItemTemplate> </controls:CarouselViewControl>


c# code behind
<br /> namespace SampleApp<br /> {<br /> public partial class MyView : StackLayout<br /> {<br /> public MyView()<br /> {<br /> InitializeComponent();<br /> myCarouselView.ItemsSource = new ObservableCollection<int> { 1, 2, 3, 4, 5 };<br /> }<br /> }<br /> }<br />

now my xaml main page
<br /> <?xml version="1.0" encoding="UTF-8"?><br /> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:controls="clr-namespace:CarouselView.FormsPlugin.Abstractions;assembly=CarouselView.FormsPlugin.Abstractions" x:Class="SampleApp.MyPage" xmlns:control="clr-namespace:SampleApp"><br /> <StackLayout x:Name="myStackLayout"></StackLayout><br /> </ContentPage><br />

my main's code behind
<br /> namespace SampleApp<br /> {<br /> public partial class MyPage : ContentPage<br /> {<br /> public MyPage()<br /> {<br /> InitializeComponent();<br /> myStackLayout.Children.Add(new MyView());<br /> }<br /> }<br /> }<br />

new MyView() is the view that contains Alex's CarrouselView, am i doing something wrong?

Change message of background's push notification

$
0
0

Hi!
I'm implementing push notifications in my app. That it's already working! With the function "DidReceiveRemoteNotification" on AppDelegate, i can treat the notifications that i receive while my app is active (this is working). When my app is in background i have read somewhere that i should use "ReceivedRemoteNotification", but this override method it's not called and when app is in background a notification without treatment appears in my screen (maybe OS handles this automatic?) with all the content that i received from the server. Well, the problem that i have is that i want to treat the information/message before showing them... How can i do it?

Any help? how can i recover my deleted messages from Samsung s6?

$
0
0

I need get back my deleted messages from my phone, I accidentally deleted every single one of my text messages from my Samsung Galaxy S6 because I was trying to get more storage space as I'm getting the "low on storage space" constantly. I failed. I deleted everything. Is there a way to find my messages again? Help?!

Cannot authorize Xamarin to access Google Play account

$
0
0

Hi,
I have an app published to the Play Store. Yesterday my laptop crashed and I had to reinstall Windows and Visual Studio. After I set everything up, I tried to publish an updated version of the app to the store. Upon reaching the "Register Google API Access" screen, I fill in the Client Id and Client Secret fields, then I hit Register. A Google authorization page loads in the browser, I give the required authorization and then I get back the standard success message ("Received verification code. You may now close this window"). However, after switching back to Visual Studio, I see this:

Looking at the Xamarin logs, I found this exception:

System.TypeInitializationException: The type initializer for 'Google.Apis.Json.NewtonsoftJsonSerializer' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. at Google.Apis.Json.NewtonsoftJsonSerializer..ctor() at Google.Apis.Json.NewtonsoftJsonSerializer..cctor() --- End of inner exception stack trace --- at Google.Apis.Json.NewtonsoftJsonSerializer.get_Instance() at Google.Apis.Auth.OAuth2.Requests.TokenRequestExtenstions.<ExecuteAsync>d__0.MoveNext()

So it seems like Xamarin is trying to use version 10.0.0.0 of Json.NET, which cannot be located. I have no idea about how to solve this. Where is the Json.NET dll that Xamarin is using located? Please help as I need to get this app update out ASAP.

Thanks in advance

MSbuild Xamarin.Forms.Android project not building when using buildscript

$
0
0

I'm trying to build an Xamarin.Forms Android project from within another visualstudio project.
My idea was to do that by executing a cmd command, or a .bat file.

I tested the msbuild command that builds the Xamarin.Forms.Android project:

MSBuild /t:SignAndroidPackage /p:Configuration=Release C:\Users\...\...\...\MyApp.Android.csproj

this command is working in the "Developer command prompt for VS 2017"
If I execute this in cmd.exe I get errors:

what I want is to get the command working in cmd.exe, or open the dev cmd vs2017 from a script.
I learned that the dev cmd vs 2017 is just a batfile that gets called before cmd.exe, so I did the same in my build.bat:

CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"
MSBuild /t:SignAndroidPackage /p:Configuration=Release C:\Users\...\...\...\MyApp.Android.csproj
pause

But this still results in an error, I tried different bat files: vsvars32.bat, VsDevCmd.bat, as admin, added my MSBuild line directly in these files, It all ends with multiple errors:

The type 'IDisposable' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstand
ard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

this error repeats a few times with different types. But I don't think the error is the problem cause my Xamarin.Forms.Android project build fine if I open the Dev cmd vs2017 manual, and enter the same MSBuild command.

Anyone who knows more about this problem, or can help me solve it?

Viewing all 204402 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>