我在本地机器上运行一个web服务,该服务运行在localhost:54722上。

我想从Android模拟器中运行的应用程序调用该服务。

我读到在应用程序中使用10.0.2.2将访问localhost,但它似乎不能与端口号一起工作。它说HttpResponseException: Bad Request。

在更新到Android Studio 2后,当我试图运行我的应用程序并选择一个模拟器时,我等待模拟器启动,它突然被杀死。我可以看到模拟器进程几分钟,但从来没有GUI。在Android studio中,我得到了错误

android studio Error while waiting for the device: The emulator process for AVD was killed

即使我在Android Studio之外运行模拟器也会发生这种情况。我试用了Android 6和基于Android 4.4的模拟器。 在Windows 7 x64 PC上运行。类似于另一个StackOverflow帖子被关闭。我尝试了各种ram、VM堆和分辨率设置。

成功克隆我的回购从heroku和添加另一个远程

1/ git clone git@heroku.com:[APP].git
2/ git remote add bitbucket ssh://git@bitbucket.org/[ACCOUNT]/[REPO].git
3/ git push bitbucket master

在运行line(3)或使用SourceTree后,我仍然得到这个错误

conq: repository access denied. access via a deployment key is read-only.

首先,我不明白这条信息在实践中意味着什么。这就是耻辱。

我确实创建了ssh密钥对并添加到heroku:

ssh-keygen -t rsa 
heroku keys:add ./id_rsa.pub 

我还在BitBucket的部署密钥部分添加了我的密钥。但我一定遗漏了什么。这个问题不是出于懒惰,我一直在阅读各种文档,包括BitBuckets指南。但它仍然没有解决这个问题。

这篇文章是有关我可以导入我的heroku git回购到bitbucket ?以及如何?

额外的事实:

ssh -T hg@bitbucket.org
conq: authenticated via a deploy key.

You can use git or hg to connect to Bitbucket. Shell access is disabled.


$ ssh -v git@bitbucket.org
OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /Users/joel/.ssh/config
debug1: Applying options for bitbucket.org
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug1: Connecting to bitbucket.org [207.223.240.181] port 22.
debug1: Connection established.
debug1: identity file /Users/joel/.ssh/id_rsa type 1
debug1: identity file /Users/joel/.ssh/id_rsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'bitbucket.org' is known and matches the RSA host key.
debug1: Found key in /Users/joel/.ssh/known_hosts:5
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/joel/.ssh/id_rsa
debug1: Remote: Forced command: conq deploykey:13907
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: read PEM private key done: type RSA
debug1: Remote: Forced command: conq deploykey:13907
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Authentication succeeded (publickey).
Authenticated to bitbucket.org ([207.223.240.181]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LC_CTYPE = UTF-8
PTY allocation request failed on channel 0

看起来一切都很好。

我正在开发Android v2.2应用程序。

我有一个碎片。在我的片段类的onCreateView(…)回调中,我将一个布局膨胀到片段,如下所示:

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.login, null);
        
    return view;
}

上面的膨胀布局文件是(login.xml):

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Username" />

    
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Username" />

</LinearLayout>

我想设置一个paddingTop到上面的<LinearLayout>元素,我想在Java代码中做,而不是在xml中做。

如何设置paddingTop <LinearLayout>在我的片段Java类代码??

如何将我的Android模拟器连接到互联网,例如使用浏览器?我已经找到了很多关于如何通过代理连接的建议,但这里不是这样,我的机器(Windows 7)是直接连接到路由器的。

有没有一种方法来保存GITHUB的用户凭证与TortoiseGit?

每当我做推/拉操作时,它都会提示我下面的对话框。

我想把我的用户凭证信息保存在某个地方,就像我用TortoiseSVN做的那样。

我尝试在Android Studio中运行我的Hello World应用程序。我得到了以下错误:

模拟器:ERROR: x86仿真目前需要硬件 加速度! 请确保Intel HAXM已正确安装并可用。 CPU加速状态:HAX内核模块未安装!

你能告诉我如何处理这个错误吗?

最近谷歌和英特尔已经发布了一种新的方式来运行模拟器,这应该比以前的版本(已经模拟ARM CPU)更好。这里有一些关于它的链接:这个和这个。

但是,在安装新组件并按照指示创建新的模拟器配置之后,我得到一个错误,也看不到任何改进。我已经尝试了API 10和API 15, GPU启用和禁用。这些配置都没有帮助。我也在两台不同的电脑上尝试过,没有任何提升(而且出现了同样的错误)。

似乎在我读过的帖子中,没有人有任何问题,所有人都报告了一个更快的模拟器。

它显示的错误是:

emulator: Failed to open the HAX device!
HAX is not working and emulator runs in emulation mode
emulator: Open HAX device failed

为什么会发生这种情况,有办法解决吗?还有其他人得到这些错误吗?反之亦然?

顺便说一下,我有一个英特尔的CPU,如果这有问题的话。


编辑:

这是我在BIOS中看到的,所以它应该是可用的…:

我正在试图弄清楚如何在每个星期天运行crontab作业。我认为以下应该可以工作,但我不确定我是否理解正确。以下内容正确吗?

5 8 * * 6

我需要一个crontab语法,它应该每分钟执行一个特定的PHP脚本/var/www/html/a.p PHP。每分钟的执行必须从00:00开始执行。另一个任务必须在00:00 /var/www/html/reset.php执行一个脚本(每24小时执行一次)。