简体   繁体   English

将值(数据)从我们的应用程序传递到android中的本机应用程序?

[英]to pass values (data) from our application to native app in android?

i am developing program for union and intersection of two strings in android, i also calculate number of character in union as well intersect results individually?the results values (union&intersect) should pass to native calculator and the result will shown in calculator? 我正在为Android中的两个字符串的并集和交集开发程序,我还计算了并集中的字符数以及单独相交结果?结果值(union&intersect)应该传递给本机计算器,结果将显示在计算器中吗?

i have to pass the that result data to native calculator? 我必须将结果数据传递给本机计算器?

examle:i have two strings 例子:我有两个弦

sunday, monday 星期天星期一

the union is: sundaymo ,the length of result union string is: 8 the intersection is : nday ,the length of result intersection string is: 4 联合为: sundaymo ,结果联合字符串的长度为: 8交点为: nday ,结果交点字符串的长度为: 4

the sum of union and intersection is : 8+4=12 ; 联合与交叉的总和是: 8 + 4 = 12 ; the values 8 and 4 should pass to native calculator ,the result should be shown in native calculator . 值8和4应该传递给本机计算器 ,结果应在本机 计算器中显示

how should i do please provide code for me please answer to me 我该怎么办,请为我提供代码,请回答

String s1 = new String("10201");
String s2 = new String("01341");


//intersect
HashSet<Character> h1 = new HashSet<Character>(), h2 = new HashSet<Character>();
for(int i = 0; i < s1.length(); i++)                                            
{
    h1.add(s1.charAt(i));
}
for(int i = 0; i < s2.length(); i++)
{
    h2.add(s2.charAt(i));
}

//union
h1.addAll(h2);

//intersect
h1.retainAll(h2);


//

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

相关问题 Android:如何从我们的应用(类似于Play商店)安装已下载的应用 - Android: how to install a downloaded application from our app similar to a playstore 如何将数据从servlet传递到android应用程序 - how to pass data from servlet to android application 从chatbot检索数据到我们的应用程序 - Retrive data from chatbot to our application React Native如何将数据从JavaScript传递到Java Android - React Native How to pass data from javascript to java android 在 android 中从我们的应用更改另一个应用的权限 - Change permission of another app from our app in android 将帧(android中的mat数据)从android传递到本机c ++并检测面部 - Pass frame(mat data in android ) from android to native c++ and detect face 如何从 android 本机代码传递 props 以响应本机 - How to pass props from android native code to react native 使用Android应用程序中的内部存储传递数据 - Pass data using the internal storage in an android application 如何使用window.localstorage从跨平台应用程序到Android本机应用程序保存的数据? - How to use window.localstorage saved data from a cross platform app to Android native app? 检索Android原生应用程序的Facebook图形数据 - Retrieving facebook graph data for android native app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM