Ripple effect on Android CardView
android:foreground="?android:attr/selectableItemBackground" android:clickable="true" android:focusable="true"
References
https://stackoverflow.com/questions/26942434/ripple-effect-on-android-lollipop-cardview
android:foreground="?android:attr/selectableItemBackground" android:clickable="true" android:focusable="true"
References
https://stackoverflow.com/questions/26942434/ripple-effect-on-android-lollipop-cardview
dropbox autostart n
from
man dropbox
@Override public boolean onCreateOptionsMenu(Menu menu) { // show option menu for current activity getMenuInflater().inflate(R.menu.search_lab_tests, menu); MenuItem menuItem = menu.findItem(R.id.itemSearchTests); final SearchView searchView = (SearchView) menuItem.getActionView(); // perform search when text changes searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { return false; } @Override public boolean onQueryTextChange(String newText) { searchData(newText); return true; } }); //return super.onCreateOptionsMenu(menu); return true; }
References
https://www.youtube.com/watch?v=j9_hcfWVkIc
Dial
*#*#2846579#*#*
and you will see a hidden menu. Go to the Project Menu > Background Setting > Log setting and define the log availability (log switch) and level (log level setting).
References
https://stackoverflow.com/questions/18124334/huawei-logcat-not-showing-the-log-for-my-app
ContextWrapper cw =new ContextWrapper(getApplicationContext()); DB_PATH =cw.getFilesDir().getAbsolutePath()+ "/databases/";
private void copyDataBase() { Log.i("Database", "New database is being copied to device!"); byte[] buffer = new byte[1024]; OutputStream myOutput = null; int length; // Open your local db as the input stream InputStream myInput = null; try { myInput =myContext.getAssets().open(DB_NAME); // transfer bytes from the inputfile to the // outputfile myOutput =new FileOutputStream(DB_PATH+ DB_NAME); while((length = myInput.read(buffer)) > 0) { myOutput.write(buffer, 0, length); } myOutput.close(); myOutput.flush(); myInput.close(); Log.i("Database", "New database has been copied to device!"); } catch(IOException e) { e.printStackTrace(); } }
References
https://stackoverflow.com/questions/18805874/copy-database-from-assets-to-databases-folder
// Ubuntu 16.04 (64 bit; 32-bit is not supported) //It is recommended that you install the server as a normal user. sudo apt-get update sudo apt-get install build-essential libssl-dev sudo apt-get install python curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.4/install.sh | bash // Force current session to know changes or logout and log back in source ~/.profile nvm install --lts npm install -g node-gyp
npm install -g realm-object-server
References
https://docs.realm.io/server/installation/manual-install
// ObjectBox browser dependencies must be set before applying ObjectBox plugin so it does not add objectbox-android // (would result in two conflicting versions, e.g. "Duplicate files copied in APK lib/armeabi-v7a/libobjectbox.so"). dependencies { debugCompile "io.objectbox:objectbox-android-objectbrowser:$objectboxVersion" releaseCompile "io.objectbox:objectbox-android:$objectboxVersion" }
<uses-permission android:name="android.permission.INTERNET" />
if (BuildConfig.DEBUG) { new AndroidObjectBrowser(boxStore).start(this); }
adb forward tcp:8090 tcp:8090
References
http://objectbox.io/objectbox-1-1-introduces-data-browser/
Close the project and find the option under File -> Other Settings -> Default Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors
Exit from Android Studio and edit the file
You should find:
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="CompilerConfiguration"> ... <annotationProcessing> <profile default="true" name="Default" enabled="false"> <processorPath useClasspath="true" /> </profile> </annotationProcessing> </component> </project>
You should set enabled to true and the boring message disappears!
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="CompilerConfiguration"> ... <annotationProcessing> <!-- This is the line where to set enabled to true --> <profile default="true" name="Default" enabled="true"> <processorPath useClasspath="true" /> </profile> </annotationProcessing> </component> </project>
apt-get -y install mysql-server mysql-client
mysql_secure_installation
apt-get -y install apache2
apt-get -y install php7.0 libapache2-mod-php7.0
systemctl restart apache2
apt-get -y install php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php-gettext
systemctl restart apache2
Enable the SSL website in apache
a2enmod ssl a2ensite default-ssl
systemctl restart apache2
Get a free SSL Certificate from Let’s Encrypt
apt-get -y install python-letsencrypt-apache
Before we can start to create the SSL cert, set the domain name in the vhost configuration file. Open the default vhost file with an editor:
nano /etc/apache2/sites-available/000-default.conf
and add the line:
ServerName example.com
letsencrypt --apache -d example.com
Let’s encrypt Auto Renewal
crontab -e
0 1 * * * /usr/bin/letsencrypt renew &> /dev/null
References
https://www.howtoforge.com/tutorial/install-apache-with-php-and-mysql-on-ubuntu-16-04-lamp/