Android start service on boot

<!– Allows application to receive actions related to rebooting –> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />   <!– Inside your <application> –> <receiver android:name="com.example.MyBroadcastReceiver" android:exported="true" android:enabled="true" android:installLocation="internalOnly"> <intent-filter> <!– Handles cold reboot (power off/on) –> <action android:name="android.intent.action.BOOT_COMPLETED" /> <!– Handles quick restart –> <action android:name="android.intent.action.QUICKBOOT_POWERON" /> </intent-filter> </receiver><!– Allows application to receive actions related to rebooting –> <uses-permission … Read more

Get image to imageview from sqlite database android studio

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Storage permission android

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Save map in file java

Save map in file Map map = new HashMap(); Properties properties = new Properties(); for (Map.Entry entry : map.entrySet()) { properties.put(entry.getKey(), entry.getValue()); } properties.store(new FileOutputStream(“data.properties”), null); Load map from file Map mapFromFile = new HashMap(); Properties properties = new Properties(); properties.load(new FileInputStream(“data.properties”)); for (String key : properties.stringPropertyNames()) { mapFromFile.put(key, properties.get(key).toString()); }

Spring application properties MySQL jpa

spring.datasource.url=jdbc:mysql://localhost:yourDatabase?serverTimezone=UTC spring.datasource.username=${USERNAME} spring.datasource.password=${PASSWORD} spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect spring.logging.level.org.hibernate.SQL=debug spring.jpa.show-sql=truespring.datasource.url=jdbc:mysql://localhost:yourDatabase?serverTimezone=UTC spring.datasource.username=${USERNAME} spring.datasource.password=${PASSWORD} spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect spring.logging.level.org.hibernate.SQL=debug spring.jpa.show-sql=true

Spigot spawn entity

World testWorld = Bukkit.getWorld(“Hello World!”); Location spawnLocation = new Location(testWorld, 0, 20, 0); Entity spawnedPig = testWorld.spawnEntity(spawnLocation, EntityType.PIG);

Android hide keyboard

public void hideKeyboard(Context context, View view) { InputMethodManager inputMethodManager = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0); }   //Call below code from inside an Activity. hideKeyboard(this, view); hideKeyboard(this, getCurrentFocus()); hideKeyboard(this, getWindow().getDecorView()); hideKeyboard(this, findViewById(android.R.id.content));public void hideKeyboard(Context context, View view) { InputMethodManager inputMethodManager = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0); } //Call below code from inside an Activity. hideKeyboard(this, view); hideKeyboard(this, … Read more