External image not displaying in Android - android

I am developing an app with VS 2019 for Windows, using Xamarin (version 3.6). My app loads images from an external source (my web server) and displays them to the user.
I built and released the Android app about a month ago, having no problems with any of the external images. Since then, I've been making updates to the project to get ready for an iOS release.
A couple days ago, I ran the project on my two android phones (both of which updated themselves recently) and now the app does not display the external images on either phone.
I am referencing image source by http, not https (makes no difference either way).
More information: When I install the app from the Google Play store (which I deployed there about a month ago), everything works fine. It's only when I try to debug from Visual Studio that the images fail to display.
Has anyone run into a similar problem?

This apparently was caused by updating my Visual Studio version. I had been using VS 2019 for Windows, and had been on an interim version (As of December, they were still in beta, I believe).
I found a suggestion in another thread to update to the last version of Xamarin Forms. I did this (version 4.4....). I had to go through some pain with the Android support libraries (apparently they are no longer needed or supported, as of December 2019). Once I got everything to compile, my images started showing up again.
There are lots of suggestions on various sites for problems similar to this, including some saying to use TLS 1.2 and Native HttpClient, but for me the Xamarin update worked. A bonus -- I got the new XAML hot-load feature, which is pretty cool.

Related

Problems with Blazor NET MAUI

So there is this new thing of Microsoft wanna-be React Native
https://learn.microsoft.com/en-us/dotnet/maui/
Right off the bat, I was trying to get it working with Visual Studio 2019.
I was following .NET 6 previews, and the blog posts of David Ortinau (the Principal Program Manager, .NET Multi-platform App UI)
It has been four or five years since I last time had a look at Xamarin, at which point I decided it was a disaster, and gradually moved to React Native as a choice of cross-platform mobile UI.
Visual Studio 2019
But after few hours of wrestling with Hyper V, and Visual Studio installer, I was able to run a simple Xamarin app, on an Android emulator. It was super slow tho, even after switching to Intel HAXM.
At this point, I think it's appropriate to ask: what's the deal with Android Device Manager on Windows vs Visual Studio Emulator for Android? They kinda seem to do the same thing, so it's confusing.
Even though the .NET 6 preview 4 states the support, after hours of wrestling with the maui-check tool, I finally gave up on VS2019, and completely uninstalled it from the system.
Visual Studio 2022
I installed Preview 3 (the latest version atm) and followed the installation guide (https://learn.microsoft.com/en-us/dotnet/maui/get-started/installation) step by step all the way.
Was able to run Xamarin Android app. And open a new MAUI project, but running it got an error message:
It looks like you are using an incompatible JDK. Please install and
configure Microsoft Mobile OpenJDK.
Which I was able to resolve with the help of this advice:
https://developercommunity.visualstudio.com/t/issues-creating-android-emulator/1467306
Unfortunately, that didn't help me much further
Building the solution now required iTunes and Apple Developer account, for hot restart.
Luckily I was able to disable that from the options > xamarin > ios
But I was still unable to build Android target. Editing the raw project file (btw, kudos for the VS team for scraping all the overload), removing didn't help either.
I still got
XamarinShellPackage did not load correctly
And when trying to still run the project:
error MSB4057: The target "Run" does not exist in the project. build
failed
Hours later, I got to the root cause of it, thanks to noticing that the Options > Xamarin didn't even open anymore.
And it was, that installing the new JDK from Oracle had changed the path so that it was only accessible for Xamarin projects, but apparently, MAUI type project is only looking at C:\Program Files\Android\jdk-16.0.2.7-hotspot
So I got the latest version on JDK from Microsoft to the above-mentioned path.
And the MAUI Blazor is working - finally! :)

Visual Studio "FileNotFoundException : Could not load assembly" issue, but without file name?

I am trying to work on a cross-platform mobile app using xamarin with visual studio 2015. However, after downloading what I think was all of android sdk/tool, I am getting the exception from the screenshot.
I read multiple if not most of "cannot load assembly" problems from Googling, but most of them have associated file url/name while I have got none of that.
Really desperate to know if anyone had come across this since this is my first time using visual studio & C#, and I am overwhelmed by the amount of new things I am learning.
Thanks
Aloe
API 24 is not fully supported in the current stable Xamarin release. It is only fully supported on a web Preview. See:
https://developer.xamarin.com/guides/android/platform_features/introduction-to-android-n/ .
So use API 23 instead and I would uninstall API 24.
Also do not use the android sdk build tools version 24 as that has been having issues as well. See:
https://releases.xamarin.com/technical-bulletin-android-sdk-build-tools-24/

Android development setup on Windows

I have php and .net programming experience.
I want to set up a development system on a windows 7 64 bit PC. I could do with database usage at a later date. I want to do it as hard coding not use software that you just drag and drop objects to play games.
I have already downloaded and installed jdk-8u20-windows-x64.exe
What do I need to do next and in what if any order.
Get your Android SDK and Eclipse IDE here
https://developer.android.com/sdk/index.html
As this is not a programming question please use Google Search or a source specific to your problem next time.
It's quite simple really. I would suggest using Android Studio, which can be found here :
Download Android Studio
It says it's a beta version but I have (and I'm not the only one) been using it for production without issues for months now. It's really a question of preference but as far as I'm concerned, I found my productivity to be much higher on Android Studio than it was using Eclipse.
Once it is installed, find the SDK manager and download the latest SDK version, build tools and other things you may need (such as the USB driver for debugging, the support library, ...) :
I highly recommend you go through the training on the official documentation page to start getting used to your new toys :-)

"App Engine Connected Android Project" not available

According to this guide by Google the "App Engine Connected Android Project"
should be available after installing/configuring ADT plugin for Eclipse, Android SDK and Google Plugin for Eclipse. I have installed everything in the most recent version in both Eclipse 3.7.2 (Indigo) and Eclipse 4.2 (Juno). However, I can't create such a project in any of the two Eclipse releases. Here are my installation details in Juno:
And here is a part of my Android SDK details:
My OS is Mac OS X 10.7.4
I know that I could see the menu point on 23/6/2012 before I updated the SDK tools to the most recent version.
Is anyone experiencing a similar issue or does anyone know what I configured the wrong way?
Thanks!
I just found a (I would say semi-official) statement from a Google employee here. It says, that the "App Engine Connected Android Project" has been removed in GPE v3.0.0. It would be possible to downgrade to the last version containing this menu item (2.6.1), which can be downloaded here.
The reason for the whole migration is, that "C2DM [is now] deprecated and [we] should be using GCM instead". Furthermore
The official docs [for using GCM] are on the way. In the meanwhile do sign up for the
endpoints trusted testers program at
http://endpoints-trusted-tester.appspot.com.
They also "plan to add [the menu item] again in the next version of GPE with GCM integrations" and they "plan to release the next version end of July".
Also, I got a similar answer form the Google employee Sparky R.:
I believe there is a known issue that the template for making
GAE-connected Android apps isn't working right now.
I don't know if it will be helpful, but i have managed to restore the Android SDK tools to rev 19 and Android SDK Platform-tools to rev 11, and installed the Google Plugin from scratch since i don't have the older version of it. It seems i still don't have the option in the menu, so i think it is about the Google Plugin.
In addition, Android Cloud to Device Messaging Framework - C2DM is deprecated since as of June 26, 2012 (https://developers.google.com/android/c2dm/). It may be about this deprecation, but it should be more clear in the near future.
I've been wasting a lot of time on this. I had the option in Eclipse 3.7, but now I've upgraded to 4.2 Juno and all the latest other stuff I can no longer see the 'App Engine Connected Android Project' option. I've had multiple attempts at installing, trying to make sure I get the order right. I've had major problems with trying to update from within Eclipse, and have had to resort to the various offline options. Not happy. How am I supposed to teach this technology when I can't even install it!
Tim
There is an example here, which he creates one of these projects:
http://bradabrams.com/2011/05/google-io-session-overview-android-app-engine-a-developers-dream-combination/
And you can checkout the code:
http://code.google.com/p/cloud-tasks-io/source/checkout
So I'm trying now to strip out what I don't need and get back to basically a new "Appengine Connected Android Project" I don't know how successful that'll be, as I don't know what I need or don't!
Annoying thing is, if this is do to with C2DM, I don't even want to use C2DM. I just want to invoke my app engine app from android, not send messages to android. Maybe I'm going along the wrong lines?
Edit
I got my project working (without messages to Android, just Android invoking methods and getting results) using these two examples:
How to call your app: Android REST client, Sample?
How to access a security enabled app: http://krasserm.blogspot.co.uk/2010/01/accessing-security-enabled-google-app.html
And this to work out how to do the http connection: http://developer.android.com/reference/java/net/HttpURLConnection.html
I'm on windows 7 and I'm also seeing this as well. This had been working for me, then I updated the Android SDK tools to rev 20 and Android SDK Platform-tools to rev 12 (both updated at the same time in the Android SDK Manager) after which I noticed this was not working. I was on Eclipse 3.7 but I upgraded to 4.2 to see if that helped (which I didn't). I then downloaded the Android 4.1 SDK stuff, but that didn't help either.
In addition to "App Engine Connected Android Project" not being ava
This feature is now available for me
Update your Android and App Engine SDKs, and you should be good to go!

Which version of Eclipse to use with Android

I'm an old developer (Active since the Z80 days) starting fresh with Android.
The Android Developers page recommends installing Eclipse before installing the Android SDK.
It also states "There are known issues with the ADT plugin running with Eclipse 3.6. Please stay on 3.5 until further notice."
The Eclipse download page seems to offer 11 different flavors of the package. None mention Android and all seem to be the Version 3.6 that the Android Developers pages recommends avoiding. - What does one do?
Comments welcome
Joe Cullity
Get version 3.5 of Eclipse for Java Developers (you can reach this page via the "Older versions" link on the main download page). One of the problems I had with 3.6 was that autocomplete would freeze up for seconds at a time, trying to look up Android source. Until they fix that, 3.5 is better.
Once you've installed Eclipse, then you can follow the instructions to install the Android plugin.
What I'm running is Eclipse Galileo 3.5.0 and works great for me.
You want to download the "flavor" labeled Eclipse IDE for Java Developers from eclipse.org
I got MotoDev which is a complete Eclipse install with the Android SDK. It has emulators for all Moto phones. Perferct start in my opinion. Plus it's all Eclipse so you can all all the other options you want.
If you are interested download here:
http://developer.motorola.com/docstools/motodevstudio/download/
have fun, I am.

Categories

Resources