Spring Boot on Android?

前端 未结 2 1392
青春惊慌失措
青春惊慌失措 2021-02-09 06:04

Is it possible to run Spring Boot on an Android device?

Right now I am successfully running a web service on localhost using Spring Boot which I\'ve g

相关标签:
2条回答
  • 2021-02-09 06:32

    You can use https://github.com/jetty-project/i-jetty to host servlet based apps in android. or embed i-jetty (replacing tomcat or netty) in your spring boot app

    0 讨论(0)
  • 2021-02-09 06:41

    Short answer is you're not gonna be able to directly run your spring boot application on your android phone. Spring boot is meant as a wrapper to quickly bootstrap Spring applications and is going to best serve you when building web based applications. As I see it you have two options.

    1. Deploy your jar on the cloud somewhere(ec2,digitalocean, heroku, cloud foundry, etc.) and just access your Spring MVC app from the android browser. If you have some really complex logic in your boot app that you don't think you can port to android, you can still deploy your boot app in the cloud, and create a really "dumb" front end android application that consumes all of it's data from the spring boot app running externally.
    2. Port you current spring boot application to a true Spring for Android project. http://projects.spring.io/spring-android/. The tools are out there to help you port it over all you have to do is put the work in.
    0 讨论(0)
提交回复
热议问题