How to set splash screen using Phonegap 3.x? - phonegap-plugins

How to setup splash screen in phonegap 3.x? I am using phonegap desktop and phonegap build. I am not using cli.
I have create a project via phonegap desktop app. So it is having all splashscreen images with all size for all platform.

Steps:
Create Splash Screen with different resolution for your platform
Create Cordova / Phonegap Projects
Add Your Platform (Android / iOS / Windows)
Install Splash Screen Plugin (https://github.com/apache/cordova-plugin-splashscreen)
Open your config.xml file & Made Changes like
<platform name="android">
<splash src="res/hdpi.png" density="port-hdpi"/>
<splash src="res/ldpi.png" density="port-ldpi"/>
<splash src="res/mdpi.png" density="port-mdpi"/>
<splash src="res/xhdpi.png" density="port-xhdpi"/>
</platform>
& add
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="5000" />
For more https://codesundar.com/setup-icon-splash-screen-for-phonegap-or-cordova-based-apps/

Related

Why is an Azure Function on .NET 6 looking for System.ComponentModel Version 6.0.0.0?

I am deploying an Azure Function called "Bridge" to Azure, targeting .NET 6. The project is referencing a class library called "DBLibrary" that I wrote, and that library is targeting .NET Standard 2.1. The Azure Function can be run locally on my PC without runtime errors.
When I publish the Azure Function to Azure, I see in Azure Portal a "Functions runtime error" which says:
Could not load file or assembly 'System.ComponentModel,
Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
The system cannot find the file specified.
I do not target System.ComponentModel directly, and I don't see a nuget package version 6.0.0 for "System.ComponentModel" available from any nuget feed. Why is the Azure function looking for this version 6.0.0 of System.ComponentModel? If that version does exist, why can't the Azure Function find it?
Here are the relevant parts of the csproj for the "Bridge" Azure Function:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Azure" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DBLibrary\DBLibrary.csproj" />
</ItemGroup>
</Project>
Here are the relevant sections of the csproj for the "DBLibrary" class library that is referenced by the Azure Function project:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<ApplicationIcon />
<OutputType>Library</OutputType>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Storage.Blobs" Version="12.10.0" />
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
<PackageReference Include="System.Text.Json" Version="6.0.2" />
</ItemGroup>
</Project>
I have tried setting _FunctionsSkipCleanOutput to true in the Azure Functions csproj because that was offered as a potential solution to nuget package resolution issues here:
https://github.com/Azure/azure-functions-host/issues/7061
That solution did not change the runtime error I saw in the Azure portal.
In my deployment pipeline, I was targeting functions runtime version ~2 for the Azure deployment when I should have been targeting version ~4 to support .NET 6. Changing to target version 4 of the Azure Functions runtime fixed the issue.
To find this setting on a deployed Function App, navigate to the Azure Portal (portal.azure.com) and search for the Function App resource's name there. Under the left navigation bar of the Function App, navigate to Settings > Configuration. After selecting the Configuration section, look for "Function runtime settings" at the top of the right pane to verify the Runtime version is "~4".
The function runtime version differences can be found here: https://learn.microsoft.com/en-us/azure/azure-functions/functions-versions?tabs=in-process%2Cv4&pivots=programming-language-csharp
This is the relevant part of the support table from the link above (as of February 2022):
Version
Support Level
Description
4.x
GA
Recommended runtime version for functions in all languages. Use this version to run C# functions on .NET 6.0.
If you have upgraded to .NET 6.0 you need to do the following to get past this error.
Update the cs proj to v4
Update the configuration in your function app in Azure to below
Update all the nuget packages for the solution
Clean the solution and then rebuild and it should work locally and should also work in Azure
The .net standard you are using 2.1 but ,Microsoft.Azure.Functions.Extensions can be support upto .NET Standard 2.0
You should add the below package to your function app and deploy to Azure again.
dotnet add package Microsoft.EntityFrameworkCore.SqlServer --version 5.0.0-rc.2.20475.6
Please refer this GitHub issue and this MICROSOFT BLOG by #Jeremy for more information.

How to embed android emulator inside Android Studio?

I know that an embedded emulator has been introduced in Android Studio 4.1+. I am not able to see options to enable it.
The changelog says that you need to enable it manually. Follow these steps:
Steps
Open Android Studio and goto Preference / Settings
Expand the Tools tab and goto emulator
Check 'Launch in a tool window'
Apart from the previous, if you dont't see the emulator tab in IDE:
I found that adding a "<module fileurl="file://$PROJECT_DIR$/android/..." line in Project directory, file .idea/modules.xml the tab appears:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/renal_calc_flutter.iml" filepath="$PROJECT_DIR$/renal_calc_flutter.iml" />
<module fileurl="file://$PROJECT_DIR$/android/renal_calc_flutter_android.iml" filepath="$PROJECT_DIR$/android/renal_calc_flutter_android.iml" />
</modules>
</component>
</project>

Data file not found error when building android OCR tesseract and hence not able to see OCR results

I am trying to build tesseract ocr with android studio. my app gets build and installed when I used connected device as my mobile.It is able to capture image but ocr results doesn't display beacuse of following logcat error:
2020-07-25 17:52:50.839 26053-26053/com.example.tess3 I/MainActivity: Created directory
/storage/emulated/0/TesseractSample/tessdata
2020-07-25 17:52:51.042 26053-26053/com.example.tess3 E/MainActivity: Data file not found at
/storage/emulated/0/TesseractSample/tessdata/eng.traineddata
My manifest permission code is:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
I am using targetsdkversion 29.
Please let me know if it is external connected related issue or do I need to download NDK also because I didn't have NDK.

Custom NuGet Package not installed in Visual Studio

I've created two NuGet package files
Foo.1.0.0.nupkg
Foo.1.0.1.nupkg
Both files are located in a folder on my PC, which I've configured as a package source in Visual Studio. I created a console app project which contains a NuGet.config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<!--
Used to specify the default location to expand packages.
See: NuGet.exe help install
See: NuGet.exe help update
-->
<add key="repositorypath" value="Packages" />
</config>
<packageRestore>
<!-- Allow NuGet to download missing packages -->
<add key="enabled" value="True" />
<!-- Automatically check for missing packages during build in Visual Studio -->
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="Confused NuGet Packages" value="D:\NuGet Packages" />
</packageSources>
</configuration>
There is also a packages.config file associated with the solution, but there are no packages listed in that file, it's a blank canvas, which is fine.
When I look in the "Online" section in NuGet Package Manager, I can see both my custom packages, but regardless of which one I choose, when I click "Install" nothing happens. The package I choose is not installed.
Why is this?
Also, when I want to update a NuGet package, how can I do this and get the new package to appear in the "Updates" section of NuGet Package Manager? How can this be done?
I'm not 100% sure if this is the answer, but I did the following and the result is that my NuGet packages now appear in the "Installed" section, as well as the "Update" section after I create a new package.
First, for the class library DLL file I was using in the package, I added it to the "lib" special folder in NuGet Package Manager.
Also I made sure that the AssemblyVersion and AssemblyFileVersion details in AssemblyInfo.cs were correct for each version of the class library. After doing these two steps, everything clicked into place.

Remove NuGet packages from all projects

Every time I create a new project, NuGet is adding a ton of packages that I don't want or need. I have tried uninstalling and reinstalling VS 2012, but somehow these packages keep coming back.
How do I completely remove them? If I uninstall NuGet, I get an error "NuGet.VisualStudio.Interop, Version=*, Culture=neutral ...
I then install NuGet, and all the old packages come back. I have no idea where this is being stored (registry?) but if I uninstall and reinstall Visual Studio, these should not be coming back.
Edit: I think I may have figured it out, but need confirmation. When I create a new, empty WebApplication, the packages are not added automatically. If I create a new, empty "Telerik MVC 4 Web Application", then I get the error shown in the picture below. I have set NuGet Package Manager to Allow NuGet to download missing packages and Automatically check for missing packages during build in Visual Studio, but I still get the error.
Edit/Solution: It turns out to be a problem with Telerik. I got this from support:
Is seems that you have ASP.NET and Web Tools 2013.1 installed.
Currently this update is not supported by our project templates. Until
we provide a support for ASP.NET and Web Tools 2013.1 I suggest you
convert an existing ASP.NET MVC Application to a Telerik UI for
ASP.NET MVC Application
This seemed to work.
The default list of NuGet packages are listed in the project templates.
You can find the templates here:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ProjectTemplates\CSharp\Web\1033
For example, if you choose MVC 4 Empty Web Application, the default packages are in the EmptyMvcWebApplicationProjectTemplate.11.cshtml.vstemplate file:
<packages repository="registry" keyName="AspNetMvc4VS11" isPreunzipped="true">
<package id="Newtonsoft.Json" version="4.5.11" skipAssemblyReferences="true" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" skipAssemblyReferences="true" />
<package id="Microsoft.AspNet.Razor" version="2.0.20715.0" skipAssemblyReferences="true" />
<package id="Microsoft.AspNet.WebPages" version="2.0.20710.0" skipAssemblyReferences="true" />
<package id="Microsoft.AspNet.Mvc" version="4.0.20710.0" skipAssemblyReferences="true" />
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.0" skipAssemblyReferences="true" />
<package id="Microsoft.AspNet.WebApi.Client" version="4.0.20710.0" skipAssemblyReferences="true" />
<package id="Microsoft.Net.Http" version="2.0.20710.0" skipAssemblyReferences="true" />
<package id="Microsoft.AspNet.WebApi.Core" version="4.0.20710.0" skipAssemblyReferences="true" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="4.0.20710.0" skipAssemblyReferences="true" />
<package id="Microsoft.AspNet.WebApi" version="4.0.20710.0" skipAssemblyReferences="true" />
</packages>
BTW: These packages are actually needed since MVC4+ is now installed entirely via NuGet.
Anyway, you can explore the other templates there and edit the .vstemplate files to add or remove the default packages.
For more information, look here:
https://docs.nuget.org/docs/reference/packages-in-visual-studio-templates
http://www.xavierdecoster.com/update-project-template-to-latest-nuget-packages
Hope this helps.

Resources