×

android生成签名 android droid

如何将android应用生成签名?在android textView中怎么实现文字的纵向的滚动

admin admin 发表于2022-05-25 23:45:35 浏览153 评论0

抢沙发发表评论

如何将android应用生成签名


1.签名的步骤

  a.创建key

  b.使用步骤a中产生的key对apk签名


2.具体操作


  方法一: 命令行下对apk签名(原理)

  创建key,需要用到keytool.exe (位于jdk1.6.0_24\jre\bin目录下),使用产生的key对apk签名用到的是jarsigner.exe (位于jdk1.6.0_24\bin目录下),把上两个软件所在的目录添加到环境变量path后,打开cmd输入-droid

D:\》keytool -genkey -alias demo.keystore -keyalg RSA -validity 40000 -keystore demo.keystore

/*说明:-genkey 产生密钥

       -alias demo.keystore 别名 demo.keystore

       -keyalg RSA 使用RSA算法对签名加密

       -validity 40000 有效期限4000天

       -keystore demo.keystore */

D:\》jarsigner -verbose -keystore demo.keystore -signedjar demo_signed.apk demo.apk demo.keystore

/*说明:-verbose 输出签名的详细信息

       -keystore  demo.keystore 密钥库位置

       -signedjar demor_signed.apk demo.apk demo.keystore 正式签名,三个参数中依次为签名后产生的文件demo_signed,要签名的文件demo.apk和密钥库demo.keystore.*/-Android

  注意事项:android工程的bin目录下的demo.apk默认是已经使用debug用户签名的,所以不能使用上述步骤对此文件再次签名。正确步骤应该是:在工程点击右键-》Anroid Tools-Export Unsigned Application Package导出的apk采用上述步骤签名。-droid


  方法二:使用Eclipse导出带签名的apk

  Eclipse直接能导出带签名的最终apk,非常方便,推荐使用,步骤如下:

  第一步:导出。

  第二步:创建密钥库keystore,输入密钥库导出位置和密码,记住密码,下次Use existing keystore会用到。

  第三步:填写密钥库信息,填写一些apk文件的密码,使用期限和组织单位的信息。

  第四步:生成带签名的apk文件,到此就结束了。

  第五步:如果下次发布版本的时候,使用前面生成的keystore再签名。

  第六步:Next,Next,结束!


  方法三:使用IntelliJ IDEA导出带签名的apk 

  方法步骤基本和Eclipse相同,大概操作路径是:菜单Tools-》Andrdoid-》Export signed apk。


在android textView中怎么实现文字的纵向的滚动


似乎textview没有纵向滚动属性,反正我没试出来,同楼上,建议用animation实现该效果,不过用不了那么多,2个就可以了,不知道楼主要在屏幕顶部实现还是其他位置? 刚才没事做了一个简单的例子,如果在顶部不用这么麻烦,写的特繁琐,把animation的各种属性都写上了,这样楼主可以根据不同的需要做修改.
package com.mygd;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationSet;
import android.view.animation.TranslateAnimation;
import android.widget.LinearLayout;

public class gundongActivity extends Activity implements AnimationListener{
/** Called when the activity is first created. */
int i = 0;
Handler handler = new Handler();

// LinearLayout linearLayout1, linearLayout2, linearLayout3;
// AnimationSet animationSet1, animationSet2, animationSet3;
// TranslateAnimation
// translateAnimation1,translateAnimation2,translateAnimation3;
// AlphaAnimation alphaAnimation1, alphaAnimation2;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
LinearLayout linearLayout1 = (LinearLayout) findViewById(R.id.linearLayout1);
LinearLayout linearLayout2 = (LinearLayout) findViewById(R.id.linearLayout2);
LinearLayout linearLayout3 = (LinearLayout) findViewById(R.id.linearLayout3);
AnimationSet animationSet1 = new AnimationSet(true);
AnimationSet animationSet2 = new AnimationSet(true);
AnimationSet animationSet3 = new AnimationSet(true);
TranslateAnimation translateAnimation1 = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF,
0, Animation.RELATIVE_TO_SELF, 0,
Animation.RELATIVE_TO_SELF, -1);
TranslateAnimation translateAnimation2 = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF,
0, Animation.RELATIVE_TO_SELF, 0,
Animation.RELATIVE_TO_SELF, -0.5f);
TranslateAnimation translateAnimation3 = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF,
0, Animation.RELATIVE_TO_SELF, 0,
Animation.RELATIVE_TO_SELF, -1);
AlphaAnimation alphaAnimation1 = new AlphaAnimation(1, 0);
AlphaAnimation alphaAnimation2 = new AlphaAnimation(0, 1);
animationSet1.addAnimation(translateAnimation1);
animationSet1.addAnimation(alphaAnimation1);
animationSet1.setDuration(1500);
animationSet3.addAnimation(alphaAnimation2);
animationSet3.addAnimation(translateAnimation3);
animationSet3.setDuration(1500);
animationSet2.addAnimation(translateAnimation2);
animationSet2.setDuration(1500);
linearLayout1.startAnimation(animationSet1);
linearLayout2.startAnimation(animationSet2);
linearLayout3.startAnimation(animationSet3);
animationSet1.setFillAfter(true);
translateAnimation1.setRepeatCount(10);
translateAnimation2.setRepeatCount(10);
translateAnimation3.setRepeatCount(10);
alphaAnimation1.setRepeatCount(10);
alphaAnimation2.setRepeatCount(10);
animationSet2.setFillAfter(true);
animationSet3.setFillAfter(true);
animationSet1.setStartOffset(1000);
animationSet2.setStartOffset(1000);
animationSet3.setStartOffset(1000);
i++;
Log.d(“xxx“, “xxx“+i);
onAnimationEnd(animationSet1);
onAnimationEnd(animationSet2);
onAnimationEnd(animationSet3);
}
// else if(i%2==1){
// AnimationSet animationSet4 = new AnimationSet(true);
// AnimationSet animationSet5 = new AnimationSet(true);
// AnimationSet animationSet6 = new AnimationSet(true);
// TranslateAnimation translateAnimation4 = new TranslateAnimation(
// Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF,
// 0, Animation.RELATIVE_TO_SELF, 1,
// Animation.RELATIVE_TO_SELF, 0);
// TranslateAnimation translateAnimation5 = new TranslateAnimation(
// Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF,
// 0, Animation.RELATIVE_TO_SELF, 0.5f,
// Animation.RELATIVE_TO_SELF, 0);
// TranslateAnimation translateAnimation6 = new TranslateAnimation(
// Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF,
// 0, Animation.RELATIVE_TO_SELF, 1,
// Animation.RELATIVE_TO_SELF, 0);
// AlphaAnimation alphaAnimation3 = new AlphaAnimation(0, 1);
// AlphaAnimation alphaAnimation4 = new AlphaAnimation(1, 0);
// animationSet4.addAnimation(translateAnimation4);
// animationSet4.addAnimation(alphaAnimation3);
// animationSet4.setDuration(1500);
// animationSet6.addAnimation(alphaAnimation4);
// animationSet6.addAnimation(translateAnimation6);
// animationSet6.setDuration(1500);
// animationSet5.addAnimation(translateAnimation5);
// animationSet5.setDuration(1500);
// linearLayout1.startAnimation(animationSet4);
// linearLayout2.startAnimation(animationSet5);
// linearLayout3.startAnimation(animationSet6);
// animationSet4.setFillAfter(true);
// animationSet5.setFillAfter(true);
// animationSet6.setFillAfter(true);
// i++;
// Log.d(“xx“, “xxx“+i);
// }

@Override
public void onAnimationEnd(Animation arg0) {
// TODO Auto-generated method stub
handler.post(new Runnable() {

@Override
public void run() {
// TODO Auto-generated method stub
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
Log.d(“xx“, “end“);
}

@Override
public void onAnimationRepeat(Animation arg0) {
// TODO Auto-generated method stub
Log.d(“xx“, “repeat“);
}

@Override
public void onAnimationStart(Animation arg0) {
// TODO Auto-generated method stub
Log.d(“xx“, “start“);
}
}
下面是xml.两个button主要是为了和顶部留有距离,
《?xml version=“1.0“ encoding=“utf-8“?》
《LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android“
android:orientation=“vertical“
android:layout_width=“fill_parent“
android:layout_height=“fill_parent“

《Button android:layout_height=“wrap_content“ android:text=“Button“ android:layout_width=“fill_parent“ android:id=“@+id/button1“》《/Button》
《Button android:layout_height=“wrap_content“ android:text=“Button“ android:layout_width=“fill_parent“ android:id=“@+id/button2“》《/Button》
《LinearLayout android:orientation=“vertical“ android:id=“@+id/linearLayout1“ android:layout_width=“fill_parent“ android:layout_height=“20dp“ android:layout_marginTop=“50dp“》
《TextView android:layout_height=“wrap_content“ android:text=“@string/hello“ android:layout_width=“fill_parent“ android:id=“@+id/textView2“》《/TextView》
《/LinearLayout》
《LinearLayout android:id=“@+id/linearLayout2“ android:layout_height=“wrap_content“ android:layout_width=“fill_parent“ android:orientation=“vertical“》
《TextView android:text=“TextView“ android:id=“@+id/textView4“ android:layout_width=“wrap_content“ android:layout_height=“wrap_content“》《/TextView》
《TextView android:layout_height=“wrap_content“ android:text=“TextView“ android:layout_width=“fill_parent“ android:id=“@+id/textView1“》《/TextView》
《/LinearLayout》
《LinearLayout android:id=“@+id/linearLayout3“ android:layout_height=“wrap_content“ android:layout_width=“fill_parent“》
《TextView android:layout_height=“wrap_content“ android:text=“1234567890“ android:layout_width=“wrap_content“ android:id=“@+id/textView3“》《/TextView》
《/LinearLayout》
《/LinearLayout》
-Android

目前最好用PC中文版android模拟器有哪些


目前市面上安卓模拟器软件看着种类繁多,但其实只有两大流派:Bluestacks和Virutalbox。Bluestacks的历史可以追溯到2011年,是最早在PC上实现流畅运行安卓系统的方案。Bluestacks的原理是把Android底层API接口翻译成Windows API,对PC硬件本身没有要求,在硬件兼容性方面有一定的优势。但Bluestacks需要翻译的Android接口数量巨大,很难面面俱到,而且存在软件翻译的开销,在性能和游戏兼容性方面欠佳。
Virtualbox是数据库巨头Oracle旗下的开源项目,通过在Windows内核底层直接插入驱动模块,创建一个完整虚拟的电脑环境运行安卓系统,加上CPU VT硬件加速,性能和兼容性都更好,但是对于电脑CPU有一定要求,超过五年以上的电脑使用起来比较吃力。
国内像靠谱助手、新浪手游助手等一大批手游助手类都是直接基于Bluestacks内核,因为Bluestacks没有公开源代码无法深度定制,只能简单的优化,再包装界面后上市。其他的像海马玩、逍遥安卓、夜神、ITools这类的产品都是基于Virtualbox,能力弱的(如海马玩、ITools)直接采用Oracle发布的Virtualbox商业版,能力强的(如逍遥安卓、夜神)则对Virtualbox源代码深度定制后重新编译来进一步提高性能和兼容性。
每个安卓模拟器有其各自特点,但都不能尽善尽美,用户在选择适合自己的安卓模拟器的时候,需要根据自己的实际情况对不同安卓模拟器进行选择:
1、BlueStacks印度公司研发。对于国内部分流行游戏兼容性没有及时支持。受制于内核技术,虽然推出时间长,但是游戏兼容性,尤其是性能欠佳。
2、靠谱助手国内最早(2013年开始)基于Bluestacks内核的安卓模拟器,优化了使用界面。但是靠谱缺少属于自己的内核技术,在兼容性和性能方面需要提升,产品不成熟。
3、海马玩国内首款基于Oracle Virtualbox商业版的安卓模拟器,2014年底产品推出时与Bluestacks内核的安卓模拟器形成鲜明对比,版本与功能更新速度慢,弹出广告插件多,占用资源明显。
4、逍遥安卓2015年中推出的基于Virtualbox深度定制的安卓模拟器。业界首创的一键多开是其亮点,国内独家支持安卓5.1.1。版本更新快,需求响应及时。模拟器性能和兼容性均不错,流畅、口碑好。
5、夜神模拟器另一款基于Virtualbox定制的安卓模拟器,直接集成NOVA桌面是它的一大特色。但多开效率需进行提升。卡顿、延迟、偶发性系统奔溃。
-droid