小编Vin*_*aba的帖子

在android中的imageview上覆盖文本

我正在尝试将文字视图叠加在图像视图上.像这样的东西

人们的应用

有人可以帮我解决这些问题.

user-interface android textview imageview

11
推荐指数
3
解决办法
1万
查看次数

Android中的人脸检测,无需用户交互

我想检测前置摄像头框架中的面部数量.一旦我使用此图像获取图像,我就可以检测到脸部:http://www.developer.com/ws/android/programming/face-detection-with-android-apis.html.但我不知道如何在没有用户互动的情况下每隔30秒使用前置摄像头捕获图像.有人可以帮助我吗?

camera android face-detection

8
推荐指数
1
解决办法
4162
查看次数

在Android中使用Directions API显示多条路线

我正在使用这个类在地图上显示路线.问题是它只显示一条路线.我想要做的是在地图上显示多个备用路线.即使服务器响应有多条路由,它也只解析第一条路由并显示它.我应该做些什么更改才能显示google服务器返回的所有路由.这是我的课程.

public class GMapV2Direction {
    public final static String MODE_DRIVING = "driving";
    public final static String MODE = "walking";
    public final static String MODE_WALKING = "walking";

    public GMapV2Direction() { }

    public Document getDocument(LatLng start, LatLng end, String mode) {
        String url = "http://maps.googleapis.com/maps/api/directions/xml?" 
                + "origin=" + start.latitude + "," + start.longitude  
                + "&destination=" + end.latitude + "," + end.longitude 
                + "&sensor=false&units=metric&mode="+MODE+"alternatives=true";

        try {
            HttpClient httpClient = new DefaultHttpClient();
            HttpContext localContext = new BasicHttpContext();
            HttpPost httpPost = new HttpPost(url);
            HttpResponse response …
Run Code Online (Sandbox Code Playgroud)

android google-maps directions google-maps-android-api-2

8
推荐指数
1
解决办法
1万
查看次数

如何将我的文件分成数据块并从我的Android应用程序中转移这些块?

我希望能够从我的应用程序传输我的文件块而不是完整的文件,以便更有效地传输它.最好的方法是什么?

更新

这是一个我需要这种方法的例子:假设我有一个4GB文件,我试图上传.如果网络出现故障,我的文件上传将停止,我将不得不从头开始.相反,如果我跟踪已经传输的块,我可以从尚未传输的块继续.这对于片状网络连接尤其重要.

performance android

6
推荐指数
1
解决办法
411
查看次数

在android中创建自定义工具栏

我试图在android中创建一个自定义扩展工具栏,工具栏中有一个编辑文本.我想要实现的布局看起来像这样

在此输入图像描述

我编写实现的代码是这样的:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"   android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"    tools:context=".MainActivity">

<android.support.v7.widget.Toolbar
    android:id="@+id/my_awesome_toolbar"
    android:layout_height="256dp"
    android:layout_width="match_parent"
    android:minHeight="?attr/actionBarSize"
    android:background="?attr/colorPrimary"

    >

    <EditText
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/searchbox"
        android:layout_alignParentBottom="true"
        android:text="Test"
        android:background="#ffffff"
        />

</android.support.v7.widget.Toolbar>
Run Code Online (Sandbox Code Playgroud)

并且Activity具有以下代码

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
    if (toolbar != null) {
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayShowTitleEnabled(false);
        getSupportActionBar().setDisplayShowHomeEnabled(false);
    }}
Run Code Online (Sandbox Code Playgroud)

但我得到的是这样的: 在此输入图像描述

没有很多关于自定义扩展工具栏的教程,所以非常感谢一些帮助.

android android-layout android-toolbar

6
推荐指数
1
解决办法
2万
查看次数

给定一组单词,如何识别"n"组字母,以帮助您从原始列表中获取最大完整单词数?

例:

n = 9
words = {Bike, Tire, Fuel, Biker, Filter, Trike}
output = {B,T,I,K,E,F,U,L,R}

(输出顺序并不重要.需要注意的是,给定像FOO这样的单词,不能使用F,O作为字母表,但总是需要F,O,O.类似的字母表分别处理)

解决这个问题最有效的算法是什么?
我正在考虑使用每个角色的频率,但这似乎没有多大帮助.

string algorithm graph

6
推荐指数
1
解决办法
1055
查看次数

是否有一种哈希技术,使得它对字符串的反向返回与原始字符串相同的哈希?

例如,此哈希函数应为这两个字符串返回相同的哈希值。

字符串a =“ hello”字符串b =“ olleh”

其背后的动机是在句子中找到重复的单词对。

string algorithm hash

1
推荐指数
1
解决办法
345
查看次数