UIAppearance – System Wide Font

Set an app wide font
[[UILabel appearance] setFont:[UIFont fontWithName:@"YourFontName" size:17.0]];

Add it to the .plist
Fonts provided by application –
Item 0: “FontName.ttf”

Pull To Refresh

Wanted to add the Pull To Refresh capability.

Useful Blog:

http://www.intertech.com/Blog/ios-6-pull-to-refresh-uirefreshcontrol/

Android – Rename a Project

Refactor didn’t change it everywhere.

build.gradle : applicationId

AndroidManifest.xml
<manifest
package=”com.company.appname” >
<application
android:label=”@string/app_name”
…>
</application>
</manifest>

Choose the “Project” view

Open “.idea” folder

Open “.name” and change here.

Run a Sync Gradle

Android – Build an Apk

Build

Generate Signed APK…

Type in your Master Password.

Choose the app folder

Run through each step and it’ll generate the apt file

This assumes you’ve already set up your keystore.jks file.

Android – Custom URL Scheme

So I’ve implemented a Custom URL Scheme in iOS and want to do the same in Android.

Make sure the android:scheme=”” is lowercase.

http://developer.android.com/training/basics/intents/filters.html

http://stackoverflow.com/questions/2448213/how-to-implement-my-very-own-uri-scheme-on-android

http://stackoverflow.com/questions/17063696/android-app-how-to-read-get-parameters-from-a-custom-url-scheme

Android – Preferences Screen

I’ve wanted to add Preferences Screen to my app.

There’s a section on Treehouse

http://teamtreehouse.com/library/android-data-persistence

Key-Value Saving with SharedPreferences

It had a lot going on and most of it was already configured

The article I found most useful was:

https://androidresearch.wordpress.com/2012/03/09/creating-a-preference-activity-in-android/

Added here in case the site goes.

Others included but were old:

http://android-elements.blogspot.co.uk/2011/06/creating-android-preferences-screen.html

http://stackoverflow.com/questions/14756457/android-deprecated-method-warning-regarding-preferenceactivity/24051942#24051942

http://stackoverflow.com/questions/15126290/adding-settings-to-android-app

Android – JavascriptInterface

http://www.lewuathe.com/blog/2014/02/21/use-javascriptinterface-on-android/

http://developer.android.com/reference/android/webkit/WebView.html

http://stackoverflow.com/questions/21749425/android-webview-addjavascriptinterface-does-not-work-if-the-webview-is-created-i

http://ganeshtiwaridotcomdotnp.blogspot.in/2011/10/calling-javascript-function-from.html

Follow

Get every new post delivered to your Inbox.