Package io.itpl.qss.helper
Class DataHelper
- java.lang.Object
-
- io.itpl.qss.helper.DataHelper
-
public class DataHelper extends Object
-
-
Constructor Summary
Constructors Constructor Description DataHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcreateForSMS(String number, String msg)* Generate a String for QR Code encoding which can trigger SMS to given number with preset text msg upon scanning.static StringcreateForTel(String number)* Generate a String for QR Code encoding which can trigger the Make a Call to given number upon scanning.static StringcreateVCardFrom(Hashtable<String,String> contactInfo)Transform the given contactInfo Map to the VCard 4.0 object.static StringcreteForLocation(double _lat, double _long)Transform the given location info (i.e.static StringgetWifiConnectionString(String SSID, String password, String security)* Generate a String for to embed the WIFI Connection with QR Code.
-
-
-
Method Detail
-
getWifiConnectionString
public static String getWifiConnectionString(String SSID, String password, String security)
* Generate a String for to embed the WIFI Connection with QR Code.- Parameters:
SSID- Name of the WIFI SSIDpassword- Password for connecting to the given SSID.security- Security type of the SSID (i.e. WEB/WPA etc.)- Returns:
- String contains the link to WIFI SSID for quick connection using QR Scan.
-
createForSMS
public static String createForSMS(String number, String msg)
* Generate a String for QR Code encoding which can trigger SMS to given number with preset text msg upon scanning.- Parameters:
number- The Target Number to initiate the SMS.msg- Predefined SMS test to be sent upon QR Scan.- Returns:
- String with SMS format
-
createForTel
public static String createForTel(String number)
* Generate a String for QR Code encoding which can trigger the Make a Call to given number upon scanning.- Parameters:
number- The Target Number to initiate the quick call.- Returns:
- String with Quick call link format
-
creteForLocation
public static String creteForLocation(double _lat, double _long)
Transform the given location info (i.e. Latitude and Longitude ) to the Location link data. The User will be able to see the given location on Map upon scanning the QR Code. *- Parameters:
_lat- Latitude value of the location._long- Longitude value of the location.- Returns:
- String with geo link
-
createVCardFrom
public static String createVCardFrom(Hashtable<String,String> contactInfo) throws QREncoderException
Transform the given contactInfo Map to the VCard 4.0 object. The QR Code scanning will response as a VCF data which can be instantly saved by user. The naming convention for the keys is listed as below,- "Name" - Name of the Contact (Mandatory)
- "LName" - Last Name of Family name (linked to FN element of VCard)
- "Company" - Name of the Organisation or Company the contact belongs to. Linked to "ORG" element.
- "Designation" - Designation of the person in given company.
- "Work-Phone" - The Telephone number mapped to "TEL:TYPE:work" element
- "Home-Phone" - Secondary Contact number mapped to "TEL:TYPE:home" element
- "Email" - Email address of the Contact
- Parameters:
contactInfo- (Hashtable object with key and value both are string) with format as described.- Returns:
- The VCard4.0 in String format (UTF-8)
- Throws:
QREncoderException- in case data is missing or having incorrect format.
-
-