Connect to bluetooth printer in Mobile app by React Native

To connect to a Bluetooth printer using React Native, you can use the react-native-bluetooth-serial library, which is one of the commonly used libraries for interacting with Bluetooth devices, including printers. Below is a step-by-step guide to setting up your React Native app for connecting to a Bluetooth printer.

Steps to Connect Bluetooth Printer in React Native:

Install Dependencies: First, you’ll need to install the necessary libraries.

npm install --save react-native-bluetooth-serial

If you’re using React Native 0.59 or earlier, you’ll need to link the package:

react-native link react-native-bluetooth-serial

Below is the React Native code to connect to a Bluetooth printer.

import React, { useState, useEffect } from 'react';
import { View, Button, Text, PermissionsAndroid, Platform } from 'react-native';
import BluetoothSerial from 'react-native-bluetooth-serial';

const BluetoothPrinter = () => {
  const [isConnected, setIsConnected] = useState(false);
  const [devices, setDevices] = useState([]);
  const [selectedDevice, setSelectedDevice] = useState(null);

  useEffect(() => {
    // Request Bluetooth permission (Android only)
    if (Platform.OS === 'android') {
      PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.BLUETOOTH)
        .then(() => {
          // Start Bluetooth scanning on permission granted
          BluetoothSerial.list()
            .then(devices => setDevices(devices))
            .catch(err => console.error(err));
        })
        .catch(err => console.error('Permission denied', err));
    } else {
      BluetoothSerial.list()
        .then(devices => setDevices(devices))
        .catch(err => console.error(err));
    }

    // Cleanup when component unmounts
    return () => {
      BluetoothSerial.stopScanning();
    };
  }, []);

  const connectToDevice = (device) => {
    BluetoothSerial.connect(device.id)
      .then(() => {
        setSelectedDevice(device);
        setIsConnected(true);
      })
      .catch(err => console.error('Connection failed', err));
  };

  const disconnect = () => {
    BluetoothSerial.disconnect()
      .then(() => {
        setIsConnected(false);
        setSelectedDevice(null);
      })
      .catch(err => console.error('Disconnection failed', err));
  };

  const printReceipt = () => {
    if (isConnected && selectedDevice) {
      // Here, you can send data to the printer
      const data = 'Hello Printer!';
      BluetoothSerial.write(data)
        .then(() => console.log('Data sent to printer'))
        .catch(err => console.error('Failed to print', err));
    } else {
      console.log('No device connected');
    }
  };

  return (
    
      Bluetooth Printer Connection

      
        Select Device
        {devices.length > 0 ? (
          devices.map((device) => (
             connectToDevice(device)}
            />
          ))
        ) : (
          No devices found
        )}
      

      
        {isConnected ? (
          
            Connected to {selectedDevice?.name}
            
            
          
        ) : (
          Not connected to any device
        )}
      
    
  );
};

The Top 5 popular content management system using .NET framework in 2020.

A Content Management System (CMS) is a software platform that allows users to create, manage, and modify digital content on a website without needing advanced technical skills like coding. It is extremely important for blogger, business owners or companies—it’s a foundational tool for managing their online presence efficiently and professionally.

Why do people use a CMS

Ease of Use – Allows non-developers (like marketers, editors, business owners) to manage content without writing code.

Faster Deployment – Build and launch websites quickly using templates and drag-and-drop editors.

Collaboration – Multiple users can manage, edit, and publish content simultaneously.

Scalability – CMS platforms can support everything from small blogs to enterprise-level websites.

Content Organization – Helps manage large volumes of structured (like articles) and unstructured (like images, videos) content.

SEO Optimization – Most CMS platforms have built-in SEO tools (meta tags, friendly URLs, sitemaps) or plugins to improve search engine visibility.

Let’s find out what are the most popular content management system using .NET framework:


Umbraco
umbraco.com
Umbraco is a highly flexible, open-source CMS with a strong focus on developer experience. Built with .NET, it supports MVC, Razor, and a customizable back-office UI. It’s widely used for both small and enterprise-level websites.

Highlights: Open-source, flexible, strong developer tools
Type: Free (with paid plans)
Cost: Free (Cloud plans from ~$40/month)
Support: ★★★★☆ (Email, forum, optional phone for paid)
Community: Large, active
Used by: Heinz, Mercedes-Benz, Warner Bros


Sitefinity
sitefinity.com
Sitefinity by Progress is a robust CMS designed for enterprise users. It offers marketing automation, headless API support, and high scalability. Great for content-heavy and multilingual sites.

Highlights: Drag-and-drop UI, personalization, multilingual
Type: Commercial
Cost: Starts around $3,000/year
Support: ★★★★★ (Phone, email, tickets)
Community: Moderate
Used by: NASA, Microsoft, Coca-Cola


Kentico
kentico.com
Kentico is an integrated CMS, e-commerce, and marketing platform. Built on ASP.NET MVC, it’s aimed at enterprise solutions with a full-featured backend, great customization, and scalability.

Highlights: All-in-one CMS + digital marketing, e-commerce
Type: Commercial
Cost: Starts around $7,999/year
Support: ★★★★★ (Phone, tickets, partners)
Community: Strong developer community
Used by: Starbucks, Mazda, Allergan


DotNetNuke
dnnsoftware.com
DNN is one of the oldest and most stable .NET CMS platforms. The free version (DNN Platform) is open-source and extendable; the Evoq version adds premium features and support.

Highlights: Open-source, modular, mature
Type: Free (Platform) / Commercial
Cost: Commercial starts at ~$2,000/year
Support: ★★★★☆ (Phone, email for Commercial)
Community: Large, long-standing
Used by: Bank of America, BP, Samsung


Orchard Core (formerly Orchard CMS)
orchardcore.net
Orchard Core is the newer, high-performance rework of the original Orchard CMS, now based on ASP.NET Core. Ideal for developers wanting a lightweight, headless-capable CMS. It’s modular, secure, and open-source.

Highlights: Modular, modern ASP.NET Core-based, headless-ready
Type: Free
Cost: Free
Support: ★★★☆☆ (GitHub issues, community)
Community: Growing, mainly developers
Used by: Microsoft, Lombiq, small businesses

Install Kendo UI Core in Visual Studio Cordova

While working on a business grade mobile app using Telerik Platform and Visual Studio 2015 Professional. I was surprised how easy to build app using Telerik Platform, especially the Kendo UI that offers visual appealing mobile tools to build hybrid mobile app.

In this tutorial, I like to show you how you can get started with the Kendo UI Core (the free version of Kendo UI Professional) in Visual Studio 2015.

VSCordovaKendoUI
Before we get started, you may ask what is Kendo UI Core? Kendo UI Core is a Open Source (Free) UI Framework. This was the decision made by Telerik in 2014. Although Kendo UI Core is a strip down version of Kendo UI Professional, you got all the power needed to build a professional mobile app and most importantly it’s FREE.

Continue reading “Install Kendo UI Core in Visual Studio Cordova”

Top 5 Open Source E-commerce Platform in .Net

Microsoft has worked harder on open source communities and projects in recent years. It turns out more and more open source .Net projects released in different categories, such as Content Management System, Blog, and E-commerce. Today I would like to show you the top 5 Open Source E-commerce system in .Net.

Before get started, E-commerce system not only offers the shopping cart functionality, but also provides tools to marketing and inventory control, integration with 3rd party providers such as payment gateway or logistic providers. Therefore, you don’t usually see Open source e-commerce platform as many as Content Management System where it focus more on “Content” instead of “Sales” and “Transactions”.

In this article, I would like to keep it simple by providing the description of the E-commerce and advantages/disadvantages to you so you can judge yourself which one is the one for you. Keep it in mind, these are the open sources projects which can be downloaded “Free”. Since it’s free to download the source code, you can either DIY or purchase upgrade version or customized theme/plugin to make your customer’s shopping experience better. So let’s get started with the top 5 Open Source E-commerce platform in .NET

Continue reading “Top 5 Open Source E-commerce Platform in .Net”

c# Multithreaded – start thread with parameter and return value

When creating an application, you will face situations where you want to launch threads in order to keep the current process responsive. The System.Threading.Thread class is used for working with threads. It allows creating and accessing individual threads in a multithreaded application. The following codes shows how to launch a thread in different ways.

Continue reading “c# Multithreaded – start thread with parameter and return value”

Master Detail view in Asp.Net MVC

The master & detail view is particularly useful in displaying a list of records. In Asp.Net 2.0, it can be achieved by using the control of gridview and detail view. However, the page reload/post back is unavoidable when the gridview item is clicked until Microsoft Asp.Net team releases the Asp.Net AJAX in 2008, Now we are going to take a look how to implement the Master Detail view in Asp.Net MVC.

image
Continue reading “Master Detail view in Asp.Net MVC”

The ‘ProviderPackage’ package did not load correctly after installation of Visual studio 2012

I was kinda free last week and decide to take a look of the new Visual studio 2012 and experience some new features. However after I successfully install the visual studio 2012 professional and tried to open up a project that was made of visual studio 2010. It gives me the following warning message

The ‘ProviderPackage’ package did not load correctly

The project still loads and compiles without problem, but everything when the project loads into the 2012. The warning message pop up and it start getting annoy so I googled a little bit and found the solution to solve this is to install the visual studio 2012 Update 2. is that that simple? Yes..

Display datetime based on user’s timezone in Asp.Net MVC

When creating an internet application/website, your users located anywhere in the world, therefore it’s important to let user to choose their own timezone and display the datetime information according to their location.

In this article, I am going to show you how to display all available Timezone information using Asp.Net MVC, and convert the original datetime to selected Timezone datetime.

img
Continue reading “Display datetime based on user’s timezone in Asp.Net MVC”

Load Json List Using Jtemplate & Asp.Net MVC

Asp.Net MVC’s controller offer a way to return in Json format. You can take the JsonReult returned from controller and populate it into the view using Jtemplate, a template engine written in jQuery way. also a perfect “client solution” to display Json data into a Asp.Net MVC View.

With this template engin in jquery, it display list of json data via ajax call so that the page does not refresh. It not only makes the user experience much better without waiting page to refresh, but also save traffic(loads faster) by returning only Json data and let the javascript to perform the rendering.

image
Continue reading “Load Json List Using Jtemplate & Asp.Net MVC”