简体   繁体   English

在 Android 和 Web 之间共享编程逻辑

[英]Share programming logic between Android an Web

I have an Android app and I'm making a web version currently.我有一个 Android 应用程序,目前正在制作一个 web 版本。

In the app there are many utility files, let's say, for the sake of an example, a class that just formates a string in a certain way.在应用程序中有许多实用程序文件,例如,一个 class 只是以某种方式格式化字符串。

Is there any way to program this just once for both platforms (android and web), and not have separate implementations for Android in Java/Kotlin, and one for Web in JS/TS?有没有什么方法可以为两个平台(android 和 web)编写一次程序,并且在 Java/Kotlin 中没有针对 Android 的单独实现,在 JS/TS 中没有针对 Web 的单独实现?

if your web page is in html, you can use in your application the Jsoup library which allows you to extract and parse data from your html web page如果您的 web 页面在 html 中,您可以在您的应用程序中使用 Jsoup 库,它允许您从 html web 页面中提取和解析数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM