我有一个sqlite数据库,其中包含用户的所有短信,但是,当您启动应用程序时,如果用户决定在两者之间使用其他短信应用程序,则我需要获取所有可能没有的短信。
我正在寻找将数据库与基本android内容提供程序同步的最佳方法。
目前我对每个短信都执行插入或忽略操作,如下所示:
insert or ignore into sms (smsID, smsCONID, smsMSG, smsNUM, smsREAD, smsTIMESTAMP, smsTYPE, smsSHORTMSG) values (?,?,?,?,?,?,?,?);
Run Code Online (Sandbox Code Playgroud)
我在启动画面活动中加载收件箱并在单独的asynctasks中发送消息,这大约需要10秒钟左右。
我的doInBackground:
@Override
protected Void doInBackground(Void... arg0) {
int thread_id = 0;
int _id = 0;
int read;
String number;
boolean first = true;
String msg;
long timestamp;
/**
* RECUPERATION DES MESSAGES RECUS
*/
// PREPARE CURSOR
cursorInbox.moveToFirst();
while (cursorInbox.moveToNext()) {
if(first){
cursorInbox.moveToFirst();
first = false;
}
// RECUPERE THREAD_ID + ID_SMS + NUMERO DU CONTACT
thread_id = cursorInbox.getInt(cursorInbox.getColumnIndexOrThrow("thread_id"));
_id = …Run Code Online (Sandbox Code Playgroud) 我试图让用户设置自己的颜色主题.我已经设法完成了这个
attr.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="extra_light" format="reference" />
</resources>
Run Code Online (Sandbox Code Playgroud)
styles.xml
<style name="Green" parent="@style/AppTheme">
<item name="extra_light">@color/extra_light_green</item>
</style>
Run Code Online (Sandbox Code Playgroud)
colors.xml
<resources>
<color name="extra_light_green">#C5E26D</color>
</resources>
Run Code Online (Sandbox Code Playgroud)
这适用于大多数应用程序,但我有一个以前的选择器
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@color/extra_light_green" />
</selector>
Run Code Online (Sandbox Code Playgroud)
至
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="?attr/extra_light" />
</selector>
Run Code Online (Sandbox Code Playgroud)
现在它崩溃了.
这是logcat,关于如何解决这个问题的任何想法?
FATAL EXCEPTION: main
android.view.InflateException: Binary XML file line #8: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:683)
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at com.android.internal.policy.impl.MiuiPhoneLayoutInflater.onCreateView(MiuiPhoneLayoutInflater.java:44)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:730)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:816)
at android.view.LayoutInflater.inflate(LayoutInflater.java:559)
at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
at android.view.LayoutInflater.inflate(LayoutInflater.java:419)
Run Code Online (Sandbox Code Playgroud)
编辑
这是我应用选择器的地方
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="50dp" …Run Code Online (Sandbox Code Playgroud) 我有一个Cordova应用程序(使用angularjs框架),这是我的观点:

当我关注一个输入时,需要视图向上移动以在(屏幕上)键盘显示时保持输入可见:

当我将焦点从输入更改为其他位置(模糊)时,键盘会关闭(就像它应该),但会将视图重绘为错误的位置:

当我使用Chrome进行检查时,它会显示所有位置的元素,而不是它们在显示屏上的位置:

我完全不知道是什么导致了这个错误,我已经尝试重新绘制onDraw方法中的视图,从而无限地重新绘制视图以查看是否会修复它但无济于事.有任何想法吗?
额外细节
Cordova版本:3.5.0-0.2.4
设备:Nexus 10 - Android 4.4.4
我想将我的数据库安装到一个单独的文件夹(@ C:\ Users\User1\AppData\Roaming\Company1\database.mdb)
我正在使用C#安装项目.
我该怎么做?
我想使用etag来缓存我的图像,第一次下载所有图像时应该这样,但第二次它也应该用304进入故障块.
我已经尝试在外部提出请求了,我得到了304就像我应该的那样,只是AFNetworking我遇到了麻烦
NSString *urlString = [API_BASE_URL_PHOTOS stringByAppendingPathComponent:[photo getPathToPhoto]];
NSString *properlyEscapedURL = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL *url = [NSURL URLWithString:properlyEscapedURL];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
if ([UserDefaultManager getEtagForKey:photo.nom] != nil) {
[request setValue:[UserDefaultManager getEtagForKey:photo.nom] forHTTPHeaderField:ETAG_IF_NONE_MATCH];
}
[request setHTTPMethod:API_METHOD_GET];
AFImageRequestOperation *operation = [AFImageRequestOperation imageRequestOperationWithRequest:request imageProcessingBlock:nil
success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
[FileUtils createDirectoryInDocumentsWithFileName:photo.folderName];
NSString *docPath = [FileUtils getPathInDocumentsWithFileName:[photo getPathToPhoto]];
// Save Image
NSData *imageData = UIImageJPEGRepresentation(image, 90);
[imageData writeToFile:docPath atomically:YES];
if ([response respondsToSelector:@selector(allHeaderFields)]) {
NSDictionary *allHeaderFields = [response allHeaderFields];
[UserDefaultManager setEtag:[allHeaderFields objectForKey:ETAG] …Run Code Online (Sandbox Code Playgroud) 我发现无法将文本集中在listview中,尝试使用wrap_content和layout_gravity = center几乎所有文本都不会移动
这是我的班级agenceEco
package com.blabla;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import android.app.Activity;
import android.app.ListActivity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.*;
public class agenceEco extends Activity {
ListView myList;
String[] listContent = {
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.agence);
myList = (ListView)findViewById(R.id.liste_agences);
ArrayAdapter<String> adapter
= new ArrayAdapter<String>(this,
R.layout.simple_list_item,
listContent);
myList.setAdapter(adapter);
myList.setOnItemClickListener(new AdapterView.OnItemClickListener() { …Run Code Online (Sandbox Code Playgroud) 我正在使用这个CoverFlow:http://www.inter-fuser.com/2010/02/android-coverflow-widget-v2.html
我想让封面流程适应不同的屏幕尺寸,
我稍微修改了封面流程,以便我使用XML布局.
以下是我的手机上的布局应该如何(320x480)

以下是Nexus One(仿真器中的480x720)的布局

COVERFLOW CLASS:
public class CoverFlow extends Gallery {
/**
* Graphics Camera used for transforming the matrix of ImageViews
*/
private final Camera mCamera = new Camera();
/**
* The maximum angle the Child ImageView will be rotated by
*/
private int mMaxRotationAngle = 80;
/**
* The maximum zoom on the centre Child
*/
// TODO RENDRE LA VALEUR DYNAMIQUE SUR LA TAILLE DE L'ECRAN
// private int mMaxZoom = …Run Code Online (Sandbox Code Playgroud) 这是我的代码
// SqlCommand query = new SqlCommand("INSERT INTO devis (idProposition, identreprise, tauxHoraire, fraisGenerauxMO, fraisGenerauxPiece, beneficeEtAleas, idStatut, prixUnitaireVenteMO ) VALUES(@idproposition, @identreprise, @tauxHoraire, @fraisGenerauxMO, @fraisGenerauxPiece, @beneficeEtAleas, 1, @prixUnitaireVenteMO) ", Tools.GetConnection());
SqlCommand query = new SqlCommand("INSERT INTO devis (idProposition, identreprise, tauxHoraire, fraisGenerauxMO, fraisGenerauxPiece, beneficeEtAleas, idStatut, prixUnitaireVenteMO, alerteEntrepriseEnvoyee,fraisDeplacement ) VALUES(1051, 85, 20, 2, 2, 2.2, 1, 88,0,-1) ", Tools.GetConnection());
//query.Parameters.AddWithValue("idproposition", this.ID);
//query.Parameters.AddWithValue("identreprise", competitor.ID);
//query.Parameters.AddWithValue("tauxHoraire", competitor.CoefTauxHoraire);
//query.Parameters.AddWithValue("fraisGenerauxMO", competitor.CoefFraisGenerauxMO);
//query.Parameters.AddWithValue("fraisGenerauxPiece", competitor.CoefFraisGenerauxPiece);
//query.Parameters.AddWithValue("beneficeEtAleas", competitor.CoefBeneficeEtAleas);
//query.Parameters.AddWithValue("prixUnitaireVenteMO", Math.Round(competitor.CoefTauxHoraire * competitor.CoefFraisGenerauxMO * competitor.CoefBeneficeEtAleas, 2));
bool insertOK = (query.ExecuteNonQuery() == 1); …Run Code Online (Sandbox Code Playgroud) 我正在尝试从麦克风录制,添加一些效果,并将其保存到文件中
我已经开始使用Android NDK中包含的示例原生音频.我设法添加一些混响并播放它,但我没有找到任何例子或帮助如何实现这一点.
欢迎任何和所有帮助.
我正在尝试在listview的外部设置边框,并在同一时间为每隔一行设置不同的颜色

这是我的适配器的getView方法
viewHolder.dateView.setText(entry.getDateString("yyyy-MM-dd HH:mm"));
if(position % 2 == 0){
viewHolder.linearLayout.setBackgroundResource(R.color.grey);
}
else{
//viewHolder.linearLayout.setBackgroundResource(R.color.white);
}
Run Code Online (Sandbox Code Playgroud)
这是xml文件,我用它来制作listview上的边框而不是单元格
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<!-- use this for transparent -->
<!-- <solid android:color="#00000000" /> -->
<!-- use this for a background colour -->
<solid android:color="@color/white" />
<stroke android:width="2dip" android:color="@color/black"/>
</shape>
Run Code Online (Sandbox Code Playgroud)
如果我将背景设置为单元格,我将无法再看到边框
当我在本地启动网站时,它运行正常,但是当我将其上传到服务器时,我得到"无法找到类型或命名空间名称'类型/命名空间..."我的App_Code文件夹
我的".aspx.cs"课程
using XXXXXX.App_Code;
Run Code Online (Sandbox Code Playgroud)
任何线索为什么?
目前有一个导航抽屉指示箭头,我该如何更改?这应该是在操作栏或滑动菜单中更改吗?
我试过这个没有运气:
sm.setSelectorDrawable(R.drawable.ic_drawer);
sm.setSelectorEnabled(true);
Run Code Online (Sandbox Code Playgroud) android ×8
c# ×3
listview ×2
afnetworking ×1
android-ndk ×1
angularjs ×1
app-data ×1
asp.net ×1
attributes ×1
audio ×1
border ×1
caching ×1
colors ×1
cordova ×1
coverflow ×1
cursor ×1
etag ×1
gallery ×1
icons ×1
iis ×1
installation ×1
ios ×1
keyboard ×1
layout ×1
save ×1
screen-size ×1
slidingmenu ×1
sms ×1
sql ×1
sql-server ×1
sqlite ×1
themes ×1
view ×1