int2hex example in delphi:
1 2 3 4 5 6 7 8 9 |
var str : string; // hex value b : byte; begin b := 15; str := system.sysutils.inttohex(b,2); end; // the result in str will be : '0F' |
hex2int example:
1 2 3 4 5 6 7 8 9 |
var strHexVal : string; // hex value intVal : integer; begin strHexVal := '0F'; intVal := StrToInt('$' + strHexVal); end; // the result in intVal will be : 15 |
In Firemonkey you can manage the virtualkeyboard on your mobile applications. if you need that the keyboard not autoshow in your application when a text box is selected you can add this code:
1 2 3 4 |
// uses FMX.Types // you can set TVKAutoShowMode = (DefinedBySystem, Never, Always); FMX.Types.VKAutoShowMode :=TVKAutoShowMode.vkasNever; |
obviusly to enable the virtual keyboard:
1 2 3 4 |
// uses FMX.Types // you can set TVKAutoShowMode = (DefinedBySystem, Never, Always); FMX.Types.VKAutoShowMode :=TVKAutoShowMode.DefinedBySystem; |
so if you have the virtualkeyboard enabled and you want to hide when and…
Leggi tutto
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
public static Map<String, String> getLatitudeLongitudeByAddress(String completeAddress) { try { String surl = "https://maps.googleapis.com/maps/api/geocode/json?address="+URLEncoder.encode(completeAddress, "UTF-8")+"&key="+API_KEY; URL url = new URL(surl); InputStream is = url.openConnection().getInputStream(); BufferedReader streamReader = new BufferedReader(new InputStreamReader(is, "UTF-8")); StringBuilder responseStrBuilder = new StringBuilder(); String inputStr; while ((inputStr = streamReader.readLine()) != null) responseStrBuilder.append(inputStr); JSONObject jo = new JSONObject(responseStrBuilder.toString()); JSONArray results = jo.getJSONArray("results"); String lat = null; String lng = null; String region = null; String province = null; String zip = null; Map<String, String> ret = new HashMap<String, String>(); if(results.length() > 0) { JSONObject jsonObject; jsonObject = results.getJSONObject(0); ret.put("lat", jsonObject.getJSONObject("geometry").getJSONObject("location").getString("lat")); ret.put("lng", jsonObject.getJSONObject("geometry").getJSONObject("location").getString("lng")); logger.info("LAT:"+lat+";LNG:"+lng); JSONArray ja = jsonObject.getJSONArray("address_components"); for(int l=0; l<ja.length(); l++) { JSONObject curjo = ja.getJSONObject(l); String type = curjo.getJSONArray("types").getString(0); String short_name = curjo.getString("short_name"); if(type.equals("postal_code")) { logger.info("POSTAL_CODE: "+short_name); ret.put("zip", short_name); } else if(type.equals("administrative_area_level_3")) { logger.info("CITY: "+short_name); ret.put("city", short_name); } else if(type.equals("administrative_area_level_2")) { logger.info("PROVINCE: "+short_name); ret.put("province", short_name); } else if(type.equals("administrative_area_level_1")) { logger.info("REGION: "+short_name); ret.put("region", short_name); } } return ret; } } catch (Exception e) { e.printStackTrace(); } return null; } |
Assuming that you know how to make a web server with TidHttpServer, but now you need to put your server in HTTPS, so to do that you need to add to your application the TIdServerIOHandlerSSLOpenSSL and set it as the IOHandler of your TidHTTpServer. IMG IOHANDLER Now you need a valid and unique certificate, to…
Leggi tutto
A new version of Remode Server is ready for Mac,Windows and Android!!! You can download the manger and have more information following this link: Remode server official page Whats new: – Extended the web interface, settings and the serail console is integrated in the the Web Admin page – Fixed a problem with camera on…
Leggi tutto