我正在尝试在我的应用程序上使用Font Awesome,我能够使用该字体集成Typeface.createFromAsset()
,但我也想使用这种字体提供的图标,但到目前为止我还没能做到这一点.
此特定字体包含Unicode专用区(PUA)内的图标,用于媒体播放器控件,文件系统访问,箭头等内容.
有没有人在Android上使用包含图标和符号的字体,这有可能吗?
我想知道在流媒体视频方面它们之间是否存在差异.
我知道VideoView
可以用于流媒体和什么是Mediaplayer
?据我所知,MediaPlayer
可以做同样的事情VideoView
吗?
任何人都可以给我答案吗?
如果我想通过使用RTSP到服务器从服务器流式传输视频,我应该从哪个开始?VideoView
还是MediaPlayer
?
有什么建议吗?
我正在尝试使用Gradle构建我的第一个项目,我认为我的gradle文件和设置是正确的.
我只使用一个模块和支持V4 + AppCompatBar库.
项目 - build.gradle
allprojects {
repositories {
mavenCentral()
}
}
Run Code Online (Sandbox Code Playgroud)
项目 - settings.gradle
include ':AssignmentTempos21'
Run Code Online (Sandbox Code Playgroud)
主模块 - build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 8
targetSdkVersion 17
}
}
dependencies {
compile "com.android.support:support-v4:18.0.+"
compile "com.android.support:appcompat-v7:18.0.+"
}
Run Code Online (Sandbox Code Playgroud)
带-i标志的控制台输出:
MacBook-Air-de-Cesar-2:AssignmentTempos21 menor$ ./gradlew -i clean assemble
Starting Build
Settings evaluated using settings file '/Users/menor/workspace_android/AssignmentTempos21/settings.gradle'.
Projects loaded. Root …
Run Code Online (Sandbox Code Playgroud) android android-appcompat gradle android-support-library build.gradle
Android Studio 2.2中的新布局编辑器会在EditText和Buttons等视图上显示此错误.此外,任何有助于使用新约束布局入门的链接都将受到赞赏.
码:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
android:id="@+id/activity_main"
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"
tools:context="com.set.email.MainActivity"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="81dp">
<TextView
android:text="To:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:layout_editor_absoluteX="7dp"
tools:layout_editor_absoluteY="4dp"
android:id="@+id/textTo"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:ems="10"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="24dp"
android:id="@+id/editTo"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium"/>
<EditText
android:layout_width="384dp"
android:layout_height="42dp"
android:inputType="textPersonName"
android:ems="10"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="94dp"
android:id="@+id/editSubject"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium"/>
<EditText
android:layout_width="384dp"
android:layout_height="273dp"
android:inputType="textPersonName"
android:ems="10"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="179dp"
android:id="@+id/editMessage"
app:layout_constraintLeft_toLeftOf="@+id/activity_main"
tools:layout_constraintLeft_creator="50"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium"/>
<Button
android:text="Send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:layout_editor_absoluteX="140dp"
tools:layout_editor_absoluteY="454dp"
android:id="@+id/btnSend"
app:layout_constraintLeft_toLeftOf="@+id/editMessage"
tools:layout_constraintLeft_creator="0"
app:layout_constraintRight_toRightOf="@+id/activity_main"
android:layout_marginEnd="16dp"
tools:layout_constraintRight_creator="0"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium"/>
</android.support.constraint.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud) android-layout android-edittext layout-editor android-studio
我必须上传一个新的应用程序,它只是设计有点不同.昨天我生成了密钥库文件来签署应用程序.我可以使用相同的吗?
在我的应用程序中,我在应用程序打开时获取当前位置的纬度和经度,但在应用程序关闭时则不会.
我正在使用Service类来获取我的应用程序中的当前位置纬度和经度.
即使应用程序关闭,请告诉我如何获取当前位置的纬度和经度
我最近阅读了关于管理你的应用程序内存的这篇文章,我强烈建议你阅读它,如果你是一个AndroidDev,从来没有.
有许多好的做法,我从未碰巧知道的一件事是系统在每个Activity/Fragment上调用的onTrimMemory(int level)方法,以通知应该或可以释放哪些内存的事件.
以下是该文章的引用:
请注意,只有当应用程序进程的所有UI组件对用户隐藏时,您的应用才会收到带有TRIM_MEMORY_UI_HIDDEN的onTrimMemory()回调.这与onStop()回调不同,后者在Activity实例变为隐藏时调用,即使用户移动到应用中的其他活动也会发生.因此,虽然您应该实现onStop()来释放活动资源(如网络连接)或取消注册广播接收器,但在收到onTrimMemory(TRIM_MEMORY_UI_HIDDEN)之前,通常不应释放UI资源.这可确保如果用户从您应用中的其他活动导航回来,您的UI资源仍可用于快速恢复活动.
我真的很想在我的应用程序中实现良好的内存管理,所以我期待以正确的方式实现onTrimMemory().
我只有几个问题:
什么"释放您的UI资源"意味着在这种情况下?只是为了清理Bitmap缓存,或者实际删除并销毁View树中的每个View?我通常会破坏onDestroy()或onDestroyView()方法中的视图,我现在想知道我是否正确行事.
是否存在onTrimMemory(TRIM_MEMORY_UI_HIDDEN)的Twin/Correspondent回调?例如onCreate-onDestroy,onStart-onStop,onCreateView-onDestroyView.我要求了解在调用onTrimMemory(TRIM_MEMORY_UI_HIDDEN)之后将活动/片段放入前台后我应该在何处以及如何恢复UI状态.
android memory-management android-fragments android-activity
我想在我的FAB右下方对齐.
android:gravity="bottom|right"
android:layout_alignParentBottom="true
" FAB
消失android:layout_alignBottom="@id/lista_tiendas"
FAB
消失它似乎并不复杂,但我无法完成它
有任何想法吗?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lista_tiendas"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:divider="@android:color/transparent"
android:dividerHeight="4.0sp"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_add_white_48dp"
app:backgroundTint="@color/spg_rosa"
app:borderWidth="0dp"
app:elevation="8dp"
app:fabSize="normal"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="@id/lista_tiendas"
/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud) 快照-1:单击菜单中的附件按钮之前
快照-2:单击菜单中的附件按钮
我在我的应用程序中有一个共享按钮,我想同时共享图像和文本.Gmail中工作正常,但在WhatsApp的,只有图像被发送和Facebook的应用程序崩溃.
我使用共享代码是这样的:
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("image/*");
shareIntent.putExtra(Intent.EXTRA_TEXT, "Message");
Uri uri = Uri.parse("android.resource://" + getPackageName() + "/drawable/ford_focus_2014");
try {
InputStream stream = getContentResolver().openInputStream(uri);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
Run Code Online (Sandbox Code Playgroud)
如果我使用"shareIntent.setType("*/*")"Facebook和WhatsApp崩溃.
有办法做到这一点吗?也许同时发送两条消息(WhatsApp).
提前致谢.
android ×9
whatsapp ×2
android-menu ×1
build.gradle ×1
facebook ×1
font-awesome ×1
gradle ×1
share-intent ×1
streaming ×1