我建立了一个Android应用程序,以控制我的空调,它曾经在Android 4.1(我使用HTC M8手机)工作正常,现在升级到5.0棒棒糖后它停止工作我附加了一个样本片段.
没有调试错误,它表示IR已传输.
- 空调品牌三星(包括开关的红外代码)
PS:我已经模拟了所有连接的代码,
//To hold my codes for remote say on, off temp+, temp-, swing etc
public class TransmissionCodes{
private int[] transmission;
private int frequency;
//+getters +setters +constructor
}
//To hold all the TransmissionCodes objects
SparseArray<TransmissionCodes> sequence ;
//power on
sequence.put(0, new TransmissionCodes(38000, "123,339,23,54,23,14,23,16,21,14,21,16,21,14,23,16,21,16,21,14,23,53,23,15,22,16,21,54,23,14,23,16,21,16,21,54,23,54,23,53,23,54,23,14,23,54,23,14,23,54,22,54,23,16,21,16,21,14,23,14,23,16,21,16,21,54,23,54,23,15,22,15,22,14,23,14,23,14,23,14,23,53,23,54,23,14,23,14,23,16,21,54,23,14,23,16,21,14,23,16,21,14,23,16,21,14,23,53,23,53,23,54,23,54,23,2500"));
//power off
sequence.put(1, new TransmissionCodes(38000, "123,339,23,54,23,14,23,16,21,14,21,16,21,14,23,16,21,16,21,14,23,53,23,15,22,16,21,54,23,14,23,16,21,16,21,54,23,54,23,53,23,54,23,14,23,54,23,14,23,54,22,54,23,16,21,16,21,14,23,14,23,16,21,16,21,54,23,54,23,15,22,15,22,14,23,14,23,14,23,14,23,53,23,54,23,14,23,14,23,16,21,54,23,14,23,16,21,14,23,16,21,14,23,16,21,14,23,53,23,53,23,54,23,54,23,2500"));
//IR call in main Activity
findViewById(R.id.button).post(new Runnable() {
public void run() {
ConsumerIrManager mCIR = (ConsumerIrManager) getSystemService(android.content.Context.CONSUMER_IR_SERVICE);
mCIR.transmit(sequence.getFrequency, sequence.getTransmission);
}
});
Run Code Online (Sandbox Code Playgroud)
这是一个接近但无法帮助的链接. Stack Overflow参考
有人可以帮我把东西放在一起,或者我错过了什么?
我正在使用 spring-boot 版本 2.0.0.M6。我需要从 spring-boot 应用程序(例如 APP1)到另一个应用程序(播放框架)(例如 APP2)进行异步 HTTP 调用。因此,如果我需要从 APP1 到 APP2 进行 20 个不同的异步调用,APP2 会收到 20 个请求,其中很少是重复的,这意味着这些重复替换了几个不同的请求。预期的:
api/v1/call/1
api/v1/call/2
api/v1/call/3
api/v1/call/4
Run Code Online (Sandbox Code Playgroud)
实际的:
api/v1/call/1
api/v1/call/2
api/v1/call/4
api/v1/call/4
Run Code Online (Sandbox Code Playgroud)
我正在使用 spring 反应式 WebClient。
下面是 build.gradle 中的 spring boot 版本
buildscript {
ext {
springBootVersion = '2.0.0.M6'
//springBootVersion = '2.0.0.BUILD-SNAPSHOT'
}
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
maven {url "https://plugins.gradle.org/m2/"}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("se.transmode.gradle:gradle-docker:1.2")
}
}
Run Code Online (Sandbox Code Playgroud)
我的 WebClient 初始化代码段
private WebClient webClient = WebClient.builder() …Run Code Online (Sandbox Code Playgroud) 我正在开发一个应用程序,我需要从联系人簿中获取所有联系人并显示.我希望用户选择一些联系人并将其添加到保存在db中的组中.
我创建了一个自定义列表视图 - contactitem.xml-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/contactname"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:layout_marginLeft="20dp"
android:ellipsize="end"
android:singleLine="true"
android:clickable="true"/>
<TextView
android:id="@+id/contactnum"
android:layout_width="wrap_content"
android:textColor="@color/White"
android:clickable="true"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/add"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:text="@string/add_contacts"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:focusable="false"
android:focusableInTouchMode="false"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
我有一个SelectContact类,用于从联系簿中获取联系人 -
public class SelectContacts extends Activity implementsOnItemClickListener {
private List<Contact> list = new ArrayList<Contact>();
private ListView contact_list;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.selectcontacts);
contact_list=(ListView)findViewById(R.id.contactsListView);
ContentResolver cr = getContentResolver();
Cursor cur = …Run Code Online (Sandbox Code Playgroud) 我正在构建一个swing应用程序,通过Internet下载多个文件并保存到windows文件共享.我已经使用了SwingWroker,它在内部使用ExecutorService,它在内部对它们进行排队并一次下载10个,但由于某种原因,下载后说2 - 3 MB的文件它会停止并转移到下一个下载文件,它们将被批量下载10个因为SwingWorker已将其固定为Executor Service的线程数.
我必须在Windows文件共享中写这些文件,我使用nio.FileChannels来做到这一点.有50-60个文件,每个重约300MB - 500MB.文件链接位于我通过登录使用登录页面上的凭据(带有帖子请求)登录的网页,然后我CookieHandler.setDefault(new CookieManager())在开始时指定,因此它对我来说就像浏览器一样.
另一个观察是当我在本地下载它们(而不是Windows服务器共享)时,它们确实可以正常工作.
这是我正在使用的代码
import java.io.File;
import java.io.FileOutputStream;
import java.net.URL;
import java.net.URLConnection;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;
import javax.swing.SwingWorker;
public class DownloadProcess extends SwingWorker<Boolean, String> {
private String urlPath, filePath;
public DownloadProcess(String urlPath, String filePath){
this.urlPath = urlPath;
this.filePath = filePath;
}
@Override
protected Boolean doInBackground() {
boolean taskState = true;
URLConnection httpConn = null;
ReadableByteChannel readableByteChannel = null;
FileOutputStream fileOutputStream = null;
FileChannel fileOutputChannel = null;
try{
//String filePath …Run Code Online (Sandbox Code Playgroud) 身份验证服务器 Api 是问题
我正在尝试在 2 个不同的服务器中在 laravel 和 Angular App 中创建一个 API。我没有得到一篇可以逐步解释我的好文章。
我面临的问题是我不确定如何处理 client_secret 我确定我需要在我的 Angular 应用程序上进行身份验证和登录时验证这一点(在服务器 laravel 上验证)
我是使用重定向 url 将其设置为 laravel 路由(因为谷歌在成功登录时使用访问令牌重定向从 angular 到我指向的任何 url)还是在我将其置于 angular 范围后从 angular 进行调用即使用rest调用将id令牌发送到laravel路由
我正在制作 laravel api,因为将来我可能有一个移动应用程序,我可以重用这个 api
我知道我可能进错了论坛。但这是我所知道的反应最快的论坛。