Android OutOfMemory When Loading Images

If you are progmatically loading an ImageView in Android, there are a couple things you need to know:

  1. By default your AndroidManifest is setup to use image optimization (think games). This is most likely bad.
  2. It does not take a large image to cause an OutOfMemoryException.
  3. The Heap size is small, by default.

To fix, change/add these lines in your manifest:

android:hardwareAccelerated="false"
android:largeHeap="true"

Bluetooth Apps on Windows

Writing Bluetooth apps to run on the Windows platform can be one of the most frustrating development experiences you will face. Who needs Bluetooth connectivity on the Windows platform? Everyone uses phones and tablets today so Windows has been forgotten by developers. That’s not true actually, Windows has been forgotten by Microsoft! That’s the frustrating part. There are many use-cases where we will need to connect to devices for testing and configuration. Our production line for one device alone has three workstations that need to connect and configure. Does Microsoft want us to use Android or iOS tablets to do that instead?

Bluetooth or BLE (Bluetooth Light) for .NET (pre Windows 10)

Microsoft has given up on the prospect of ever supporting (in any useable fashion) Bluetooth for .NET. They absolutely do not support IN ANY WAY Bluetooth Light. (4.0). What they currently do for Bluetooth Classic connections is map a paired device to a SerialPort. You have to use an old SerialPort class in .NET to communicate and it works almost half the time. That is until the new Windows 10 updates (2017) when they broke it completely without any explanation or help. This means app’s we had in production just didn’t work any longer after updating the OS overnight.

How to get Bluetooth (and BLE) to work on Windows?

1. Upgrade to Windows 10
2. Upgrade your Windows 10 version to “Fall Creators Edition”
3. Change your development platform to Universal Windows Platform (UWP).
4. Make sure you have the latest (Fall 2017) UWP Libraries.

If you are lucky enough to be able to do the above, you will have access to Microsofts full Bluetooth and BLE libraries that make connectivity easy (and fun!). Those libraries are not available for any .NET development (that I have found) unless you have the above stack. If your experience is different, let me know!

Introducing PlanEOL

We are proud to introduce a new venture we have been working on for over a year. PlanEOL.com

A typical IT department has thousands of different IT assets, and their product lifecycle (End of Life) is critical for continued success. PlanEOL has one of (if not the) largest database of product lifecycle information, and it is growing every day. A subscription gives you the following:

Full access to the product database
Personal Roadmap of your IT assets with ability to export
Alerts for updates and additions
Notifications for upcoming End of Life dates
Access to specific vendor support information

A friend of ours was working at a large bank and tasked with identifying an upgrade schedule for all hardware and software assets to keep current on support. He wanted to sign up for a service to manage the process for him. After looking for a few hours he called me up and asked why there wasn’t a service he could subscribe to or at least a searchable database for support information? The idea for PlanEOL was born at that moment and we got to work.

Loading Server-Side Properties on Angular Startup

Sometimes you will need server-side properties (not exposed to the web) in your client-side angular app. A couple examples would be Stripe (payment service) key’s and Google ReCaptcha keys. These keys are normally saved in a properties file because they are different for each environment. To load them on startup (or refresh) in your angular app, do the following:

In APP.JS

/**
* Initialization of the APP, and refreshing...
*/
app.run(function ($rootScope, $state, $http) {

// Do an initial instance/session check here
$http.get('properties').then(function successCallback(response) {
        $rootScope.properties = response.data;
    }, function errorCallback(response, exception) {
        console.log(response);
        console.log(exception);
    });
});

The call to http://localhost:8080/properties should be a REST call that returns a JSON object of your properties.