This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
############################################################################## | |
# | |
# E-Invoice Module - Ecuador | |
# Copyright (C) 2014 VIRTUALSAMI CIA. LTDA. All Rights Reserved | |
# [email protected] | |
# $Id$ | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private int mInterval = 5000; // 5 seconds by default, can be changed later | |
private Handler mHandler; | |
@Override | |
protected void onCreate(Bundle bundle) { | |
// your code here | |
mHandler = new Handler(); | |
startRepeatingTask(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Transform hexadecimal String example | |
public byte[] hexStringToByteArray(String s) { | |
byte[] data; | |
int len = s.length(); | |
data = new byte[len / 2]; | |
for (int i = 0; i < len; i += 2) { | |
data[i / 2] = (byte) ((Character.digit( s.charAt( i ), 16 ) << 4) | |
+ Character.digit( s.charAt( i + 1 ), 16 )); | |
} | |
return data; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo add-apt-repository ppa:ondrej/php -y | |
sudo apt-get update -y | |
sudo apt-get install php7.2 php-pear php7.2-curl php7.2-dev php7.2-gd php7.2-mbstring php7.2-zip php7.2-mysql php7.2-xml | |
sudo apt-get install libapache2-mod-php7.2 -y | |
sudo a2dismod php5 | |
sudo a2enmod php7.2 | |
sudo service apache2 restart | |
sudo composer self-update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install python-software-properties -y | |
sudo add-apt-repository ppa:ondrej/php -y | |
sudo apt-get update -y | |
sudo apt-get install php7.2 php-pear php7.2-curl php7.2-dev php7.2-gd php7.2-mbstring php7.2-zip php7.2-mysql php7.2-xml | |
sudo apt-get install libapache2-mod-php7.2 -y | |
sudo a2dismod php5 | |
sudo a2enmod php7.2 | |
sudo service apache2 restart |