How to use 'apple system font' in android application - android

We developed an application in IOS using 'apple-system-font' and we loved this font so we want to use the same font for all TextViews in the android application.
So Is there any way to use 'apple-system-font' in the android application like the following:
<TextView
...
android:fontFamily="-apple-system-font" />

Latest iOS uses 'Helvetica Neue' as system font. You need to download the font file and then add it in your assets. This process is explained in this StackOverflow question.
Note that Apple may choose to change this font over time. Also, even though the font is highly legible and crisp, the users on an Android device may not be used to seeing it. this may result in a 'different' experience for them. Make sure you do proper user testing before adding the feature in production app.

Related

How to create a system app for custom ROM

We have a custom ROM for a device we are making and what I want to do is make our own custom Settings app to replace the settings app that comes already built in android.
I cant really find any documentation on how to even create a system app. It does not appear you can create it in Android Studio, I tried looking on the AOSP site and didnt find anything there related to creating system apps. The few things I did find were on here where you would put android:sharedUserId="android.uid.system" in your manifest and then has to be signed with the same key as the ROM but after that I cant find anything.
The settings app I want to create would need access to the framework.jar to be able to use the hidden framework API's.
Does anyone have any information or know where I can find this information on how to go about actually creating a system app?
You may want to research how to make a Device Tree Overlay (dto). Basically it is your code, reformatting the base code, into what you want. https://source.android.com/devices/architecture/dto?hl=en
Since you said you use Gradle, you should put first build you apk and put them in you vender folder, and next important thing is to create a mk/bp file to tell the Android build system how to deal with this pre-built apk.
P.S. If you system app highly depends on Android hidden api, make sure you have the right version of framework.jar in you Android Studio project, or, as what I alway did, create apps directly in AOSP, in this case, you can just check the code structure of the original Settings app in AOSP
this tutorial may help you.

Custom Android MMS/SMS application from source code?

Okay here's the deal:
I want to download the full source of the MMS/SMS application that ships with Android phones. I want to be able to modify it, and add a little custom functionality to it.
I am developing using Eclipse, and I'm on Windows 7. I have noticed that there is now a Git for Windows, but I am pretty lost in it and not sure how to integrate everything with Eclipse.
Basically, I want to just get it to the point where I have all the source code visible in Eclipse and be able to see the app run JUST like the built-in texting/MMS app that is already on my phone. Then I'll know that I can modify it and proceed.
Any ideas?
Thanks!
There's a mirror of the SMS/MMS app on GitHub here. Just import that to Eclipse and customise away.
Unless you want to customize and use it only on your own phone (without publishing), this is not a good idea. This is because it uses classes that are hidden from the sdk. By default you won't even be able to build the apk via eclipse, but there is a way. The reason why this is a bad idea is that the hidden apis are not guaranteed to remain the same through different api-levels and your app can stop working with the next android update, and might also not work on previous api-levels. In-fact your app might not even work on selected phones running the same api-level.

Testing internationalisations / translations

Is there a way to easily test out my translations for an Android app on a developer phone, if your phone's Settings->Languages menu doesn't have those? For example, to test translations for a desktop Linux application, I can run it like so:
LANG=de_DE.UTF-8 ./myapp
Is there a similar setting or trigger to do this for an Android app?
There's a lot of good information at http://developer.android.com/guide/topics/resources/localization.html
Bottom line: If your developer phone doesn't support the locale you want to test, it's not worth the effort to make it work. Instead, do your testing on an emulator.
The emulator has a large selection of built-in locales. If you can't find the one you want in there, look for an application called "Custom Locale" installed in the emulator.
Run "Custom Locale", and define the locale you want to use. It's really quite easy.

Where is the drawable for the handle of a SlidingDrawer defined?

I want to use a SlidingDrawer in an activity, and I would love to just use the built-in tray handle, rather than try to find or create my own. I found it online thanks to CommonsWare but I assume that they got it from the Android platform itself, so I figure it will benefit me in the long run to know where to find it, rather than just use their copy of it. I looked for it in my Android SDK installation, under platforms/android-8/android.jar/res/ but with no success.
Where can I find the above image, in the Android SDK itself, rather than just downloading it?
Look in the launcher app: ~\platform\packages\apps\Launcher\res\drawable\handle.xml
It uses all the drawables: tray_handle_normal, tray_handle_pressed, tray_handle_selected.
may be you can type android.R.drawable... in eclipse and let the intelli-sense display all the built in drawables.
but I think it's not there cause I searched for it and didn't find it too
thanks
Be carefull with using images that come with the system. Google itself states that they will not guarantee that these images will be included in the system in every release (the name may change). Also the design of your app will change if the user uses something like Blur or Sense that overrides a lot of the standard design items. If you use a copy of the drawable itself you now how your app will look and you can be sure that your app will keep working even if the manufacturer or Google changes the images that come with a device.

Is this a built in drawable?

In this linked image , I see the button on the right quite often in a lot of apps. On my Moto Droid, it is used extensively in the settings app. It is also used as the default AlertDialog icon. Can I use this via a android.r.drawable?
The icon is built-in with the Android development, you can access the image by using R.drawable.ic_dialog_menu_generic
While it may be possible to use it via android.R.drawable, you may want to find the image in the resources that come with your SDK ($ANDROID_HOME/platforms/$VERSION/data/res, where $ANDROID_HOME is where you have the SDK installed and $VERSION is a relevant Android API level). So, per Mr. Forloney's answer, you'll find that in, say, drawable-hdpi/ic_dialog_menu_generic.png in the aforementioned directory. Then, copy that image into your project. While it will add 5K to your project size, it will mean that the icon does not change based upon OEM or Android changes.

Categories

Resources