Skip to main content

Posts

iOS Dynamic Type

On iOS devices within accessibility section of general settings you can change the text size, making it (much) larger or smaller. I hadn't come across this before, but to get your application to work with the user's settings you use 'Dynamic Type'. These are "UIFontTextStyle" elements which will automatically size around the user's text size setting. The settings available and their relative sizes are:Large Title - 44ptTitle 1 - 38ptTitle 2 - 34ptTitle 3 - 31ptHeadline - 28ptBody - 28ptCallout - 26ptSubhead - 25ptFootnote - 23ptCaption 1 - 22ptCaption 2 - 20ptThese values can be set in "Text Stye" for relevant elements, in xCode click the 'T' for the font and select desired style from the list.Note: if you want your page to automatically resize existing elements if the user changes the text size whilst your app is open you can override 'awakeFromNib()' and set '.adjustsFontForContentSizeCategory' to 'true' for…
Recent posts

Saying yes to one thing is saying no to something else!

The one bit of advice I wish I'd received much earlier in my career is:Saying yes to one thing means that you are always saying no to something else!It seems pretty obvious when you think about it, as time is finite. So every little task you take on, is consuming a part of that finite resource. When you're starting out, you're probably 'time rich / cash poor' which is probably the worst combination as it almost always rewards taking too much on. You've got more time and you're still learning, so over committing a little won't hurt surely? The worst possible thing then probably happens, you're rewarded for your efforts with promotion and salary increases.....and the beginnings of a bad habit is quickly formed / re-enforced.In the beginning you are probably saying no to your leisure time:- I really want to get this done and I'd only be sitting at home and it's only this once / small thing. Slowly, as your career develops, you'll most…

Error updating SQLCipher

We recently encountered a bug when migrating an android application from Eclipse to Android Studio. As a part of this migration the reference to SQLCipher version was updated from a really old (several years old) version to 3.5.4. After the migration, for existing users, the application was falling over and using the log (below) we identified it was failing when trying to use the new version of SQLCipher to open a database that had been created / encrypted using the older legacy version.E/Database: file is encrypted or is not a database: , while compiling: select count(*) from sqlite_master; net.sqlcipher.database.SQLiteException: file is encrypted or is not a database: , while compiling: select count(*) from sqlite_master; at net.sqlcipher.database.SQLiteCompiledSql.native_compile(Native Method) at net.sqlcipher.database.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91) at net.sqlcipher.database.SQLiteCompiledSql.(SQLiteCompiledSql.java:64) at net.sqlc…

Creating libraries and .NET Standard

As part of his fantastic 'What is .NET standard' presentation at DDD12, Adam Ralph provided an amazing amount of detail in such a short amount of time. One of the most valuable points, which is completely obvious when you think about it, is how you should work with .NET standard when creating libraries.NET standard now comes in a multitude of flavours: currently 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6 and 2.0. When starting out with something new, we (as developers) often want to be as cutting edge as possible and probably haven't read the small print / finer details. So as a result, when creating our first .NET standard library a natural tendency is to create it targeting .NET Standard 2.0. Of course, that makes perfect sense - it's the newest so must be the best? It's definitely true, it is the latest and has the largest .NET framework coverage. BUT, and it is a big but. The library you are building can now only be used by other libraries targeting .NET Standard…

Know your frameworks, never stop learning!

Last year, as part of a series of posts, I asked "Are you investing in your own career?". This, in part, came about from a great quote that heard:Do you have 10 years experience, or 1 year's experience repeated 10 times?I think the majority of developers starting out are fired up and excited every day. Everything is new, everything is a challenge. Just getting something to work, no matter how, is a success.It can also be amazingly frustrating and tiring to be constantly learning and actively building your knowledge / skill-set. It's probably not a surprise therefore that it is so easy / appealing to back off a little bit for a break once you have learnt enough to satisfy the day job. Similar to over training in sport, it's probably even a good idea - no one can do anything flat out indefinitely.But what happens when you just continue backing off? The hard truth is, rather than continuing to build your experience, you do slowly start to fall into the trap o…

Accessing a "Class Library (.NET Standard)" from a "Console App (.NET Framework)"

If you're trying to access a class library (.NET Standard) from a traditional console application (in VS2017 those can be found under 'Windows Classic Desktop') you will run into problems; which can feel a little strange for something that was pretty simple in VS2015 and earlier. You can add a reference to the class library project (Resharper will even volunteer to add the dependency / namespace reference if you don't already have it). But the code won't then compile, it will complain that it can't find the namespace referenced in the using and it also won't be able to find any of the objects that you reference in the class library. Took me a bit of figuring out but you need to open up the properties for the class library project, look at the conditional compilation symbols in the build tab (it might be something like 'NETSTANDARD1_4'). You need to take this symbol and duplicate it in the build tab of the console application. You should now be…