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

Is it possible to edit Xamarin .axml layout files with Visual Studio 2015 or I need to update?

$
0
0

Due to a version license restriction at work, I have to develop a Xamarin Android app using Visual Studio 2015. I must say that I'm using Visual Studio 2019 (Student version) on my personal computer, and everything works fine, but I can't develop with that license at work.

On my work computer, I have installed and updated the Xamarin for Visual Studio 2015 extension, and using Java Runtime Environment v1.8.0_241 and Java Development Kit v1.8.0_231, as I read on so many guides, here my config:

About my project, I have created a new Xamarin Android Project, with no more files than the empty project includes, and with no code modified by my side. But when I want to just add a Button, I get this error when trying to open the .axml file.

"Connection to the layout renderer failed. This may be caused by a misconfiguration of Java."

Here the full error report:

java.lang.NoClassDefFoundError: com/android/utils/ILogger
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: com.android.utils.ILogger
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 7 more
Error: A JNI error has occurred, please check your installation and try again
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0
Picked up _JAVA_OPTIONS: -XX:MaxPermSize=256m
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Exception in thread "main"
Last line about "ignoring option MaxPermSize=256m" is due to a environment variable I created following guides, but now I have run out of options :/

I'm questioning if it is even possible to develop with Xamarin using Visual Studio 2015 or I have to ask my boss to upgrade license.

I appreciate any support. Thanks.


Where is SQL Lite DB

$
0
0

I created my first small app using VS 2019. I can perform CRUD operations successfully. I also have installed DB Browser for SQL Lite. When debugging the application i get the following path for Android

/data/user/0/com.companyname.alimobile/files/.local/share/country.db3

My database name is country.db3. I have the following specific question
1. Can I open the Database .db3 using DB Browser for SQL Lite - the way I will do using SQL Server management studio
2. Will I be able to add/edit table to schema
3. Will this change in schema be automatically applied to both IOS and Android

Thanks in Advance

Manage content in a page

$
0
0

I need app structure like this:
First page list of books. Selected book navigates to new page with a content:

  • List of titles.
  • List of quotes.
  • Book info like author, date and so on.

    I dont want to scroll content, its too big. I want this page as one, but splitted into tabs or something like that. You can add titles and quates from tab bar.

Thought to use tabbedpage, but docs says:
"While a NavigationPage can be placed in a TabbedPage, it's not recommended to place a TabbedPage into a NavigationPage."

Though about shell but look like its more for menu items.

What are other options? To use some buttons and hide/unhide content?

Is there another local database other than SQLite which works with Xamarin?

$
0
0

Hello, I'm wondering what options are there for a local database which can be integrated with Xamarin.Forms, other than SQLite (since it can't handle high concurrency)? I've searched online and haven't found any information.
Thanks in advance!

How to display the last SMS

$
0
0

HI
I create an application that sends after the codes, and is answered by messages from the phone company.
What I want is to get the last message done after pressing a button.
It can be more than one message.
Where some messages are sent from the company after sending the code in unlimited seconds.

What I think about is setting the time to press the button, and showing any message after that time.

my code to get last sms
`
public void getAllSms()
{

            var contactList = new List<string>();

            string INBOX = "content://sms/inbox";
            string[] reqCols = new string[] { "_id", "thread_id", "address", "person", "date", "body", "type" };
            Android.Net.Uri uri = Android.Net.Uri.Parse(INBOX);
            var cursor = ContentResolver.Query(uri, reqCols, null, null, null);

        //save date time before click
        ISharedPreferences prefe = PreferenceManager.GetDefaultSharedPreferences(this);
        ISharedPreferencesEditor editor = prefe.Edit();
        editor.PutString("DATE", DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss"));
        editor.Apply();
        //

        if (cursor.MoveToFirst())
            {
            do
            {

                String messageId = cursor.GetString(cursor.GetColumnIndex(reqCols[0]));
                String threadId = cursor.GetString(cursor.GetColumnIndex(reqCols[1]));
                String address = cursor.GetString(cursor.GetColumnIndex(reqCols[2]));//
                String name = cursor.GetString(cursor.GetColumnIndex(reqCols[3]));//
                String date = cursor.GetString(cursor.GetColumnIndex(reqCols[4]));//
                String msg = cursor.GetString(cursor.GetColumnIndex(reqCols[5]));//
                String type = cursor.GetString(cursor.GetColumnIndex(reqCols[6]));//

                string datesav = prefe.GetString("DATE", "");
                DateTime dt1 = DateTime.ParseExact(date, "MM/dd/yyyy HH:mm:ss", null);
                DateTime dt2 = DateTime.ParseExact(datesav, "MM/dd/yyyy HH:mm:ss", null);
                TimeSpan ts = dt1.Subtract(dt2);

                if (Convert.ToInt32(ts) > 0)
                {
                    contactList.Add((messageId + (","
                                              + (threadId + (","
                                              + (address + (","
                                              + (name + (","
                                              + (date + (" ,"
                                              + (msg + (" ," + type)))))))))))));

                   }

                } while (cursor.MoveToNext());

                  contactList.Add(contactList.First());
                 adapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, contactList);
                 ListView.Adapter = adapter;


        }
        else
        {

        }

        }

`

Deep linking not setting up default app for android

$
0
0

I configured app according to microsoft xamarin android guide(can't post url because I'm new on forum) and can't make my application to open links by default with deep linking. My project is open source on github(account: Parvex, project: StudentSurveySystem.MobileClient).

-I set Intent filter for links for my test azure domain
-InstalledAppLnks nugget and configured it in MainActivity.cs
-Added assetlink.json file in /.well-known with debug keystore SHA256 fingerprint

Google api says that assetlink.json is ok but when debugging there's always dialog asking which app to use. I need to have my app handling links by default because I've written custom oauth 1.0 with redirect url getting back to app.

WKWebView EvaluateJavaScript refreshed page

$
0
0

WKWebView EvaluateJavaScript refreshed page

Xamarin Forms iOS Exception Handler, get current exception handler

$
0
0

So recently we wanted to add New Relic analytic/crash reporter to our app. Our app currently has many analytic and crash reporters all working together. However when integrating New Relic on iOS side, we get an error saying it got replaced as the exception handler: Error: The New Relic exception handler has been replaced. This may result in crashes no longer reporting to New Relic.

Now i know of the iOS limitation of one handler only (Apple Docs).

Ive tried removing the other services/libraries and i still get the error and crashes are not reported. Im wondering if its something Xamarin (or App Center SDK, Distribute, Crashes, Analytics) related more as most of these libraries are also used in conjunction with new relic on other apps i hear. So im trying to use NSGetUncaughtExceptionHandler at various points to see when/where/who replaces the New Relic one and work from there. I dont see anything in the Xamarin iOS docs about that method or where/how to use it.

Ive seen this post, Xamarin Forum Post but dont know how to use it or makes much sense to me.

Any help with the ios unhandled exeception handler would be greatly appreciated.


How to access Files from Platform Specific Folders in Xamarin.Forms?

$
0
0

Hey,
I want to access a File in Xamarin.Forms which is located in the Resources folder of my Xamarin.Android / Xamarin.iOS. Is this even possible?
The other way round isn't a possibility because the files on the platform specific parts get referenced via javascript (needed for augmented reality functions).

"D/AbsListView( 3323): viewType is heaer or footer" message constantly scolloing in debug

$
0
0

Anyone know why the message below is constantly filling up the debug window? it seems the message has "header" spelled incorrectly as well. What does it mean?

02-08 23:28:45.031 D/AbsListView( 3323): viewType is heaer or footer
02-08 23:28:45.041 D/AbsListView( 3323): viewType is heaer or footer
02-08 23:28:45.051 D/AbsListView( 3323): viewType is heaer or footer
02-08 23:28:45.231 D/AbsListView( 3323): viewType is heaer or footer
02-08 23:28:45.241 D/AbsListView( 3323): viewType is heaer or footer
02-08 23:28:45.241 D/AbsListView( 3323): viewType is heaer or footer

Nathan

An error occurred while trying to start the Broker...?

$
0
0

I receive this when trying to connect to a mac on my local network after the latest update and i am using vs2015

ImageButton has a gray transparent "filter" on top of the image + blue

$
0
0

Every image I have in my ImageButtons have a gray transparent "filter" that I can't get rid off.

I tried to set the background color to transparent, the opacity to 0 and so on but neither of these 2 solutions worked.

I also have a blue background on the image when it's selected (not pressed), can't get rid off that neither.

Anyone has a solution ?

[Xamarin Essentials] iOS - Launcher.TryOpenAsync return true but the application is not open

$
0
0

Hello everyone,

I'm trying to used Xamarin.Essentials.Launcher.TryOpenAsync with iOS but that always return me true.
I create my schemes in the info.plist. For example :

    <dict>
        <key>CFBundleURLName</key>
        <string>com.microsoft.Office.Excel</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>mssDevMicrosoftExcel</string>
        </array>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>

I add my schemes in the whitelist in the info.plist. For example :

<key>LSApplicationQueriesSchemes</key>
    <array>
        <string>mssDevMicrosoftExcel</string>
    </array>

I'm url look likes this:

await Launcher.TryOpenAsync("mssDevMicrosoftExcel://");

Someone have an idea?

Best regards

Dark mode - TraitCollectionDidChange firing 4 times when app goes into background

$
0
0

Hello,

During debugging:

our x-platform app supports ios dark mode with this implementation:

[modernizing-ios-apps-dark-mode-xamarin](https://devblogs.microsoft.com/xamarin/modernizing-ios-apps-dark-mode-xamarin/](https://devblogs.microsoft.com/xamarin/modernizing-ios-apps-dark-mode-xamarin/](https://devblogs.microsoft.com/xamarin/modernizing-ios-apps-dark-mode-xamarin/)

No matter what mode chosen, every time the app goes into background the override TraitCollectionDidChange is fired exactly 4 times.
1. previous mode != present -> call SwapTheme() -> theme changes
2. previous mode != present -> call SwapTheme() -> nothing changes since App.Theme is the same
3. previous mode != present -> call SwapTheme() -> theme changes
4. previous mode != present -> call SwapTheme() -> nothing changes since App.Theme is the same

Lastly I get this message:
Can't end BackgroundTask: no background task exists with identifier 34 (0x22), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.

Most of the times nothing happens and I can resume the app but occasionally the app do crash because of this.

My Dev env:
Xamarin.Forms.4.4.0.991265

Microsoft Visual Studio Enterprise 2019
Version 16.3.10
VisualStudio.16.Release/16.3.10+29519.87
Microsoft .NET Framework
Version 4.7.03190

Installed Version: Enterprise

ADL Tools Service Provider 1.0
This package contains services used by Data Lake tools

AndroidSignatureToolCommand Extension 1.0
AndroidSignatureToolCommand Visual Studio Extension Detailed Info

Application Insights Tools for Visual Studio Package 9.1.00913.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2019 16.3.286.43615
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019 16.3.286.43615
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.3.286.43615
Azure App Service Tools v3.0.0

Azure Data Lake Node 1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio 2.3.9000.0
Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools 16.3.286.43615
Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio 2.3.9000.0
Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Debugging Tools for Windows 10.0.18346.1000
Integrates the Windows Debugger functionality (http://go.microsoft.com/fwlink/?linkid=223405) in Visual Studio.

Extensibility Message Bus 1.2.0 (d16-2@8b56e20)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Fabric.DiagnosticEvents 1.0
Fabric Diagnostic Events

IntelliCode Extension 1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure HDInsight Azure Node 2.3.9000.0
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service 2.3.9000.0
Language service for Hive query

Microsoft Azure Service Fabric Tools for Visual Studio 16.0
Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Stream Analytics Language Service 2.3.9000.0
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node 1.0
Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.20816.1

Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 2.0.83+gbc8a4b23ec
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Mono Debugging for Visual Studio 16.3.7 (9d260c5)
Support for debugging Mono processes with Visual Studio.

Node.js Tools 1.5.10807.1 Commit Hash:4d3cf548113f5a53a02d83a877ee24e764b2cde4
Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager 5.3.1
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Snapshot Debugging Extension 1.0
Snapshot Debugging Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.61908.27190
Microsoft SQL Server Data Tools

ToolWindowHostedEditor 1.0
Hosting json editor into a tool window

TypeScript Tools 16.0.10821.2002
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.4 for F# 4.6 16.3.0-beta.19455.1+0422ff293bb2cc722fe5021b85ef50378a9af823
Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers

Visual Studio Tools for Kubernetes 1.0
Visual Studio Tools for Kubernetes

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

Windows Driver Kit 10.0.18346.1000
Headers, libraries, and tools needed to develop, debug, and test Windows drivers (msdn.microsoft.com/en-us/windows/hardware/gg487428.aspx)

Xamarin 16.3.0.281 (d16-3@859f726)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.3.0.256 (remotes/origin/d16-3@8a223bfd7)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.3.565 (27e9746)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 10.0.6.2 (d16-3/c407838)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: mono/mono/2019-06@476d72b9e32
Java.Interop: xamarin/java.interop/d16-3@5836f58
LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94
LibZip: nih-at/libzip/rel-1-5-1@b95cf3fd
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.27.1@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-3@cb41333

Xamarin.iOS and Xamarin.Mac SDK 13.6.0.12 (e3c2b40)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

View Pdf in Xamarin Android

$
0
0

Hello everyone, I am a beginner Xamarin Developer, and I want to view a pdf in my Xamarin Android App. Is there any solution to this issue? I have made some research on this topic but no answers... Please help me, I am in a hurry to finish my project and I don't know what to do anymore. Thanks !


View Pdf file in Xamarin Android App

$
0
0

Hello everyone, I am a beginner Xamarin Developer, and I want to view a pdf in my Xamarin Android App. Is there any solution to this issue? I have made some research on this topic but no answers... Please help me, I am in a hurry to finish my project and I don't know what to do anymore. Thanks !

Enviar datos desde el puerto otg.

$
0
0

Buenas tardes, nuevamente consultado al foro. Estoy intentado enviar datos desde el puerto otg por medio de un adaptador usb-serial a una pc la pc recibira esos datos desde el puerto serial, en la parte del harware no hay problema pues tengo todo para hacer la conexion.

Lo que no logro hacer es poder enviar datos, en buscado información, pero no logro entender la logica de como hacerlo. He tratado de usar los ejemplos que hacer de XamarinUsbSerialForAndroid de LusoVU pero no le entiendo.

Por favor si alguien me puede echar una mano se lo agradeceria.

Saludos.

Element That Does Not Move in Tabbed Page

$
0
0

Hey! Sorry, maybe this is not a correct question but i am pretty new to Xamarin.Forms and I was wondering if i can put some elements in tabbed page. for example image, that does not move when You switch between tabs. I hope You understand my question!

Scope Bar in Android

$
0
0

I have implemented an App under iOS which uses a scope bar (which is an extension of the iOS search bar).

This is an iOS SearchBar with ScopeBar :

I would like to implement the same functionality under Android, and am familiar with the SearchView control.

Can anyone tell me :

1) is there an Android equivalent of the iOS ScopeBar ?

2) if not, are there any established design patterns for providing this functionality in Android?

Thanks

CarouselView doesn't set its position, CurrentItemChanged and PositionChanged don't work either

$
0
0

I have a gallery app. There is a grid with several images in it. When a user clicks on the image, it displays the fullscreen version of it using a carousel. The problem is that even though I set the carousel's position to the index of my image in the list, it displays the first image in the carousel everytime. While debugging, I can see that the position is correctly set, but it doesn't display the image correctly.

I also have issues when sliding in the carousel. The methods "CurrentItemChanged" and "PositionChanged" never trigger.

Anyone has a solution ?

Viewing all 204402 articles
Browse latest View live


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