Skip to main content

Posts

Showing posts with the label android

Beginners' NativeScript + Angular to develop Android apps - Getting started guide

NativeScript ( https://github.com/NativeScript ) is a java script framework that enables you to create native Android or IOS mobile applications. It is considered to be faster than Cordova or PhoneGap (which is webview based frameworks as opposed to native code generated from java script). Best features of NativeScript - NativeScript supports Angular (4/5) , TypeScript , regular java script and it also has a plugin for Vue.JS - NativeScript can generate native applications for Android and IOS with one code base. - NativeScript playground  https://play.nativescript.org  - this is a platform like jsfiddle, plunkr to write and execute and see the result of small NativeScript applications. NativeScript Performance Comparison: The following link shows a simple ios app comparison benchmarks with these other frameworks. Native   - Xcode 6.3.2 NativeScript   - NativeScript for iOS 1.6.0 Xamarin   - Xamarin Studio 5.10.2 Appcelerator   - Appcelerat...

Xamarin release build error: obj\Release\android\AndroidManifest.xml(0,0): Error: Error parsing XML: unknown encoding

ERROR: \Release\android\AndroidManifest.xml(0,0): Error: Error parsing XML: unknown encoding ( ) CAUSE: Android Application  Version Name  is not in right format (encoding="utf-8") , so it is using a default with  <?xml version="1.0" encoding="Windows-1252"?> FIX: In the project options set android application - versionName to 3 digit version like "1.0.0",  not "1" or  "1.0"  Ex: android:versionName="1.0.0" After this change the code will compile and you can see this following line in the obj\Release\android\AndroidManifest.xml(0,0) <?xml version="1.0" encoding="utf-8"?>

NPM install Errors: '../build/Release/bson' 'MODULE_NOT_FOUND' js-bson: Failed to load c++ bson extension, node-gyp.js rebuild, ENOENT

 ISSUE: Node.js modules build errors NPM install Errors:  '../build/Release/bson' 'MODULE_NOT_FOUND'  js-bson: Failed to load c++ bson extension, node-gyp.js rebuild, ENOENT CAUSE: Even  if python path is set in the Windows' environment variable and in the path, node-gyp is not picking the python path . If you type 'python' from any directory it might work. But node-gyp will still through these errors.  It is confusing as in CLI python works if you call python.exe, but node-gyp doesn't find it, so you decide to try on every thing else you can find online. - If there is a C++ error , node-gyp rely on visual studio's C++ compiler to build. You might need to set Visual C++ path or version in the CLI command.  - long directory or path name issue in Windows: Windows only can handle 260 charecters in a given path name (oooooooooops. This is not an easy fix for windows as the core OS is built on top of this limitation.) . You have to make it sim...

ListView change background color for selected items ( Xamarin - Android )

Issue: How to change  background color for all selected items in Android Fix: ( Xamarin  - c# syntax - Android should work with little change)      myListView . ItemClick   += ( sender ,   e )   = >   {                 myListView . GetChildAt (   e . Position ) . SetBackgroundColor (   Color . White ) ;                              } ; This will show the color change on all selected items. If you use myListView _ItemSlected event -> The color only shows like a highlight and when you select the next item the background color changes back to default.  

Android - Xamarin - The name ‘Resource’ does not exist in the current context / Changing namespace issue

ERROR: The name ‘Resource’ does not exist in the current context, CAUSE: - You tried to change namespaces in the project. Most of the time when you try to work with open source code  , you might like to change the naming convention relevant to your  project (depending on the license) . When you try to change namespace in the code, there are 3 major places it affects when compiling. In this  3 items are dynamically created . But they don't get modified if you make a major change like Namespace in your code. 1. Project default Namespace setting. 2. Resource.design.cs 3. obj/debug/ * 4. bin/debug/* FIX: Change the 'default namespace' setting in 'Projects' > [project name] Options - in general tab. Rebuild the project and if you get the same error again , open all the files (or Find and replace) the old Namespaces with new Namespace. Rebuild again this will create a new Resource.design.cs  If the Error occurs again - Open this file and verify...

Android: Xamarin Studio: Cannot find: C:\Android\SDK\tools\..\platform-tools\aapt.exe

Error: Android: Xamarin Studio: Cannot find: C:\Android\SDK\tools\..\platform-tools\aapt.exe Fix: 1. Check your Target Device / OS version you set up in the AndroidManifest.xml 2. Open the Android SDK Manager, see if that version is listed . 3. You may not have installed all the SDK versions of Android (like 13, 14, 15,16,17,18, 19,....) 4. This above error shows- You have installed an SDK , but but you donot have the ' platform SDK Build tools ' for the target version you have in your AndroidManifest.xml file. 5. From the list of plaform tools - install the version you need. The below picture shows the list of 'SDK Build tools' under 'Tools' in Android SDK Manager. (This shows  Android SDK Build-Tools for all the versions are installed )

Xamarin Studio: Execution Failed. Object reference not set to an instance of an object.

ERROR:   Xamarin Studio: Execution Failed. Object reference not set to an instance of an object. ISSUE:  When you try to run your project by menu item 'Run Item' from Xamarin Studio project, the top middle status bar shows the above error. FIX: 1. Notice that in the top bar - the second dropdown is empty (Device list). 2. You have to set your project as a 'Set as Startup project' - (Right click on the project name to see this option in the popup menu) - This is the situation when you have or had multiple projects in the solution or running the project inside an existing solution. The 'Run' command needs to know what project to associate with what device.

Android: No resource found that matches the given name (at background with value '@drawable/ xxxX')

ERROR:  No resource found that matches the given name (at background with value '@drawable/XxxXxx') FIX: Use all lower case when you specify the image file name in the Values / styles.xml. It doesn't matter if you have camel letters in the filename under the Resource Folder. Example:  Instead of this, < item   name = " android : windowBackground " > @drawable/ Splash < / item > Use, < item   name = " android : windowBackground " > @drawable/ splash < / item >