boot

Start an Activity on Phone Boot in Android

假装没事ソ 提交于 2019-12-30 07:16:05
问题 I want to start my application automatically when the phone boots. I declared a BroadcastReceiver in the manifest file. <receiver android:name=".Autostart"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> I made a java file for the receiver. Autostart.java public class Autostart extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent)

SpringBoot从入门到实战

泄露秘密 提交于 2019-12-30 02:54:42
Spring Boot框架从入门到实践 SpringBoot初相识 一、SpringBoot框架简介 SpringBoot是Spring家族中一个全新的框架,用来简化Spring应用程序的创建和开发过程,SpringBoot能简化我们之前采用的Spring MVC+Spring+MyBatis框架进行开发的过程 以往我们采用Spring MVC+Spring+MyBatis框架进行开发的时候,搭建和整合三大框架,需要做很多工作,比如配置web.xml,配置Spring,配置MyBatis,SpringBoot抛弃了繁琐的xml配置过程,采用大量的默认配置简化我们的开发过程。 Spring Boot可以非常方便的搭建基于Spring框架的应用程序,让编码变简单,配置变简单,部署变简单,监控变简单。 二、SpringBoot的特性 能够快速搭建基于Spring的应用程序 能够直接使用Java Main方法启动内嵌的Tomcat服务器运行Spring Boot程序,不需要部署War文件 提供约定的Starter POM来简化Maven配置 根据项目的Maven依赖配置,SpringBoot自动配置Spring、Spring MVC等 提供了程序的检查检查等功能 基本不使用XML配置文件,采用注解配置 三、SpringBoot四大核心 自动配置:针对很多Spring应用程序和常见的应用功能

spring boot 部署为jar

一笑奈何 提交于 2019-12-30 00:52:46
本文转载自: https://www.cnblogs.com/woshimrf/p/5887293.html 作者:woshimrf 转载请注明该声明。 前言 一直在ide中敲代码,使用命令行 mvn spring-boot:run 或者 gradlew bootRun 来运行spring boot项目。想来放到prod上面也应该很简单。然而今天试了下,各种问题。最大错误是1.4的bug: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: Unable to resolve persistence unit root URL 这个错误使我一直以为自己的代码有问题。找了半天没找到,最后想既然命令行可以运行ok,那么一个fat jar失败肯定不对了。于是上github去问,以为石沉大海准备睡觉的

win7添加usb3.0驱动

社会主义新天地 提交于 2019-12-29 23:38:58
从系统iso中提取boot.wim,和install.vim 1、建立d:\win7文件夹,在该文件夹下新建windows和drivers文件夹,并且将制作的win7的映像文件中的source文件夹下的boot.wim和install.wim复制到win7文件夹下。 2、dism /mount-wim /wimfile:boot.wim /index:2 /mountdir:windows 3、dism /image:windows /add-driver:drivers /recurse 4、dism /unmount-wim /mountdir:windows /commit 这样,boot.wim文件的驱动就安装完了,然后我们继续往另一个文件install.wim中添加该驱动,如下图 dism /mount-wim /wimfile:install.wim /index:2 /mountdir:windows dism /image:windows /add-driver:drivers /recurse dism /unmount-wim /mountdir:windows /commit 来源: 51CTO 作者: supersyd 链接: https://blog.51cto.com/204222/2458772

Spring Boot 基本配置 学习

北战南征 提交于 2019-12-29 23:22:43
Spring Boot 一些基本配置 # 定制化Banner Spring Boot 项目在启动的时候会有一个默认的启动图案: 1 2 3 4 5 6 7 . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v1.5.9.RELEASE) 我们 可以 把这个图案修改为我们自己想要的。 在 src/main/resources 目录下新建banner.txt文件,然后将自己的图案粘贴进去即可,ASCII图案可通过网址: http://www.network-science.de/ascii/ 一键生成,比如输入mrbird 生成团后复制到banner.txt, 启动项目。 banner 也可以关闭,在main方法中: public static void main (String[] args) { SpringApplication app = new

Spring Boot 集成 Ehcache 缓存,三步搞定!

眉间皱痕 提交于 2019-12-29 22:51:15
本次内容主要介绍基于Ehcache 3.0来快速实现Spring Boot应用程序的数据缓存功能。在Spring Boot应用程序中,我们可以通过Spring Caching来快速搞定数据缓存。 接下来我们将介绍如何在三步之内搞定 Spring Boot 缓存。 1. 创建一个Spring Boot工程 你所创建的Spring Boot应用程序的maven依赖文件至少应该是下面的样子: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.3

(32)Spring Boot使用@SpringBootApplication注解,从零开始学Spring Boot

给你一囗甜甜゛ 提交于 2019-12-29 22:19:17
【来也匆匆,去也匆匆,在此留下您的脚印吧 , 转发点赞评论】 如果看了我之前的文章,这个节你就可以忽略了,这个是针对一些刚入门的选手存在的困惑进行写的一篇文章。 很多 Spring Boot 开发者总是使用 @Configuration , @EnableAutoConfiguration 和 @ComponentScan 注解他们的 main 类。由于这些 注解被如此频繁地一块使用(特别是你遵循以上最佳实践时), Spring Boot 提供一个方便的 @SpringBootApplication 选择。 该 @SpringBootApplication 注解等价于以默认属性使用 @Configuration , @EnableAutoConfiguration 和 @ComponentScan 。 这是官方进行解析的,我个人自己第一次接触的时候也是有这个困惑的,希望此篇文章能解答在研究 Spring Boot 困惑的人。 【Spring Boot 系列博客】 61. mybatic insert 异常: BindingException: Parameter 'name' not found 【从零开始学 Spring B 】 60. Spring Boot 写后感【从零开始学 Spring Boot 】 59. Spring Boot Validator 校验【从零开始学

SpringBoot入门

走远了吗. 提交于 2019-12-29 21:44:40
Springboot入门 SpringBoot是什么? Spring Boot它本身并不提供Spring框架的核心特性以及扩展功能,只是用于快速、敏捷地开发新一代基于Spring框架的应用程序。也就是说,它并不是用来替代Spring的解决方案,而是和Spring框架紧密结合用于 提升Spring开发者体验 的工具。 同时它集成了大量常用的第三方库配置(例如Jackson, JDBC, Mongo, Redis, Mail等等),Spring Boot应用中这些第三方库几乎可以 零配置 的开箱即用(out-of-the-box),大部分的Spring Boot应用都只需要非常 少量 的配置代码,开发者能够更加专注于业务逻辑 注1:敏捷式开发 注2:spring boot其实不是什么新的框架,它默认配置了很多框架的使用方式, 就像maven整合了所有的jar包,spring boot整合了所有的框架 使用Idea配置SpringBoot项目 右击 new —> Module 项目名小写 搭建运行成功 java源文件夹中的Springboot01Application.java是整个项目的启动类 static:存放的是静态资源的文件 templetes:存放的项目所需的页面 application.properties里面存放的是项目的全局配置信息 项目启动成功访问界面如下 测试案例代码

Idea 打包maven项目 以及spring boot 的自动配置

99封情书 提交于 2019-12-29 14:13:44
1.打包maven项目 1. 选中Java项目工程名称,在菜单中选择 File -> project structure ... (快捷键Ctrl+Alt+Shift+S)。 2.在弹出的窗口中左侧选中" Artifacts ",点击" + "选择jar,然后选择" from modules with dependencies "。 3.在配置窗口中配置" Main Class "。选择“Main Class”后配置“Directory for META-INF/MAINFEST.MF”,本文中选择的项目根目录,配置完成后如下图所示,点击OK进入下一步。 4.在弹出的窗体中选中" Build On make "(make 项目的时候会自动输出jar) 5.以上的步骤就完成了编译时生成Jar包的配置,然后在菜单中选择 Build -> make project 。 6.build success 后,去该项目的out文件夹内查找本项目的jar包 OK,jar打好,下面才是重头戏: 首先说下这个jar包的用处:自动获取当前项目的属性值(仅是测试,功能、业务性不强) 接下来,如何实现呢? 这里要了解spring boot条件注解这个概念,有如下注解形式:                                        @ConditionalOnBean

Android Boot-Up BroadCast Not invoking

烂漫一生 提交于 2019-12-29 07:21:10
问题 I am currently trying to make a broadcast receiver which will invoke after android device boots and then will run a background service. I have tried many examples but don't know where I'm going wrong. I am following this example: https://github.com/commonsguy/cw-advandroid/tree/master/SystemEvents/OnBoot I have imported this whole project in my workspace and tried to run. But the receiver didn't invoked or so. Please help me out. My Testing Device is: Motorolla Xoom with ICS 4.0.3 EDIT