August 23, 2013 By: Will Verduzco
Over the years, the process for connecting Android devices to proxy servers has changed dramatically. Originally only supporting global configuration, now configurations can be set on a per access point basis. Furthermore, applications such as OpenVPN can work globally on devices running Ice Cream Sandwich and later.
So what do you do if you’re building an application and you want your to know a user’s proxy configuration? Up until now, this would be a pretty difficult task. Luckily, XDA Forum Member lechuckcaptain has already gone through the hassle so that you don’t have to. He has created a library to do this for you, regardless of the user’s Android version supporting from 1.x through 4.x. The library began with determining current proxy configuration, but has now grown to also ascertaining proxy status and other relevant information.
August 19, 2013 By: Will Verduzco
Think back to all those times when your non-tech savvy parents have called you over for free computer tech support. What’s one unifying theme from all of these instances? If your loved ones are anything like mine, it’s a horde of uninstalled updates awaiting approval. This is unfortunately all too common, as most of the technologically illiterate simply ignore update notifications, without realizing that these updates often patch vulnerabilities and add important features.
Luckily on Android, updates can be set to automatically install if the app’s permissions haven’t changed. However, not everyone has auto-update enabled, and even those with the option enabled may not take the time to manually update applications with changed permissions in the app manifest. In these instances, users need a little bit of prodding to get them to be a man and do the right thing—update their applications.
As a developer, not having users on the latest version of your app can be problematic. After all, who wants users complaining about broken features that have already been fixed two versions ago? Thankfully, XDA Senior Member rampo created a library to help with this problem in your own app. So how does the library work? Simple. UpdateChecker is a class that when called checks to see if the app is updated to the latest version available in the Play Store by parsing your app’s desktop Play Store listing. If there is a newer version available, the user is then prompted to update.
Head over to the library thread to prod your users to update.
We’ve featured plenty of tools in the past that allow an end-user to modify his or her own build.prop. We’ve also featured a set of tools for app developers to incorporate that allow applications to modify the file. These (obviously) all require root access, as you’re modifying system settings. However, to date we haven’t featured a method of reading the build.prop from an app.
There are plenty of reasons why an app developer would want read-only access a device’s build.prop. Be it to know about its software or hardware configuration, or simply to peek into some system settings, looking into this treasure trove of information is potentially quite useful for an app developer. However, requiring root access to do so is unnecessary from both user hassle and security standpoints.
In a quest to access the build.prop from his own app without resorting to root, XDA Forum Member torpedo mohammadi wrote a couple of lines of code and shared it with the community. The way he goes about it can be summarized in his explanation:
1. Make a process which executes “getprop” from the “/system/bin/getprop” directory and initialize the String which we want to get (ro.board.platform in example).
2. Make a BufferedReader which gets the value (String) by retrieving the data from a inputStreamReader().
3.Convert the BufferedReader to String.
Head over to the original thread to get started, copy the code, and get it implemented into your app.
It’s no secret that visual aids such as charts and graphs help in effectively disseminating numerical information. After all, who really wants to read an essay of numbers? That feeling is only exacerbated when the reading is done on a small cell phone screen. Thankfully, as apps are becoming more and more visually enriched, dull data visualization is nearly a thing of the past.
To help developers better display exactly the data they need in their apps, XDA Senior Member Androguide.fr created HoloGraphLibrary. Forked from a separate base library by developer Daniel Nadeau, Androguide.fr’s offering builds on the original by adding support for various unit display types and compatibility with Android Studio and Gradle.
In addition to providing his forked library, Androguide.fr has also included a comprehensive guide on how to use the library in his thread. So what are you waiting for? Don’t display numbers as text; it’s not pretty. Head over to the library thread to get started.
If you’re looking to get started creating a user interface for your app, there are various ways of getting started. You could always start from scratch, learning the entire process as you go along. In fact, that’s probably the ideal way of doing it, provided you have the time, as you’d have a deeper understanding of how things work and how to fix problems
if when they arise.
However, ain’t nobody got time to do things the long way. To help speed things along for new developers who would rather concentrate on core functionality code rather than UI layouts, XDA Senior Member AuxLV created GrilledUI, an open source streamlined library aimed at easily creating common UI layouts. As described by AuxLV:
Available UI types are: tabbed UI (TabActivity), master/metail flow (SectionActivity) and their hybrid (HybridActivity). These activity classes wrap everything you need to create your UI with just a few lines of code or even load tabs/sections and instaniate fragments from XML file. HybridActivity allows you to have tabs on phones and MDF on tablets. This way you can easily make your app tablet and phone friendly without torturing phone users with multiple activities.
Included with the library are multiple examples, a BSD license, and support for pre-ICS devices using ActionBarSherlock. Head over to the resource thread to get started and visit the Github to take a peek at the source.
Let’s imagine that you’re putting the finishing touches on your application, when you suddenly realize one thing: You wish to add in the ability to modify a device’s build.prop directly from the app.
Yes, this is far from applicable to every app developer. However, quite a few classes of apps could make use of the ability to modify a device’s build.prop such as tools that allow users to change what device an end user’s phone identifies as, or an app that just gives users the ability to modify the build.prop directly themselves.
Now, if you’re currently developing your application and would like to bake in the ability to modify the build.prop file, you could obviously figure out how to do it yourself. Alternatively, you could check out an open source library created by XDA Senior Member Tezlastorme geared at helping you add exactly that functionality into your own app.
Created out of necessity when Tezlastorme needed but couldn’t find such a library himself, he decided to spare future developers from having to reinvent the wheel in their projects. In his own words:
Over the past few days I have been working on making a library that makes it easier for app developers to edit the build.prop file from their applications. I decided to make this library when I needed to edit build.prop from within an app I’m developing and I couldn’t find a library to make this simple. So, after I had worked out how to do it and tested the code in my app, I made it into a library, because I think this will help quite a few developers.
Those looking to add in build.prop modification to their should head over to the original thread to get started.
July 7, 2013 By: Will Verduzco
Geolocation games are just inherently cool. Don’t believe me? Just think how much of the magic of Ingress would be lost if it weren’t based on your position.
If you’re a mobile games developer, you more than likely have already considered creating your own geolocation-based game. Thankfully, if you decide to force others to get off their lazy behinds by creating such a game, XDA Forum Member Robyer has a library that you can use that will help get you started without much hassle.
Originally created as part of his Bachelor’s degree thesis, the Gamework library is currently aimed at creating single-player games without moving enemies (i.e. without enemies or AI). Thus, you’re best left using it for puzzle or strategy games. However, Robyer is eager to hear suggestions to expand the library to support additional features that developers may desire.
Want to know the best part? The library is fully open source, licensed under Apache v2, meaning that you can use it however you’d like—even for commercial applications. So if you have any ideas and want to either contribute to the development of the library or create your own game, you should head over to the original thread.
Everyone who builds ROMs knows about the repo tool, right? I say wrong. You can build ROMs all the live long day and know nothing about it. But you’ll face-palm after learning about what you’re missing.
The repo tool is a Python script that adds a layer of abstraction between you and Git. Git is of course the source code management system used by the Android code base. If the last two sentences were more gibberish than sense here’s the breakdown: The repo tool automatically handles the source code base needed to build a custom ROM. The previous link takes you to a page for the repo tool itself, but you’ll need a shove in the right direction to start using it efficiently.
Head on over to XDA Senior Member Red Devil’s guide on the subject. The original thread, which is part of XDA-University, covers the basics (and then some) in a graphic rich, well organized, and non-bloated way. After explaining what each part is about, Red Devil shows how to install the tool and use it to automatically pull down the code base. He even hits the GUI version of the folder to show what the file structure looks like after that step. From there, you’ll learn about the XML manifest files that govern how the tool operates on your local copy of the code. Even if you’re already quite comfortable with the repo tool, it’s worth your time to hit the second post in the thread to hear some pro tips.
June 19, 2013 By: Mike Szczys
It’s frustrating to see slick new features that you can’t use when supporting devices with older versions of Android. Sometimes Android adds in support for a few previous versions, like when the ActionBar was added. But other times, you’re just going to have to do it yourself. That’s what XDA Senior Member icechen1 did to make the slick looking TimePicker from Android 4.2 work with devices as old as 2.1 (Eclair).
He’s calling it MicrowaveTimePicker, which is a great descriptor. These screenshots show that the button layout and time display is exactly what you’d expect to see on the control panel of a microwave oven. That familiar look is what great interfaces are made of, as most users will immediately feel at home typing in the the time setting.
The library is available from his GitHub repository. The readme file documents how easy it is to start using it. Add the Class as an item in your preference menu xml, and it’ll launch like an Activity. There is also the option of displaying the interface programmatically as a dialog.
You can find links to other 4.2-like pickers in the comments of the Reddit thread. Icechen1 many have duplicated some work by building up his own library, but it can’t hurt for the rest of us to have several to choose from.
It’s pretty easy to build APKs using Eclipse, but The Apache Ant project brings a few things to the table which you might be interested in—especially if you’re creating closed source apps. The package is designed to handle Java application builds (although it can be used with other languages as well). One of its best traits is that it will help shrink the size of your code by parsing for unused variables, methods, and classes to then strip them out as cruft. But I did mention closed source, and that’s because Ant has the ability to help obfuscate your bytecode to help prevent reverse-engineering through the use of ProGuard.
One of the reasons more people don’t use it is that it can be a little daunting at first glance. But to help you get a foothold, check out this setup guide for Ant builds. It’s not exactly tailor made, but if you search additional resources like the Ant Project Page itself, you should be able to get things working. The final project will spit out two builds at the touch of a button. One will be a private build for your own use during debugging. This code hasn’t been obfuscated, unlike the other package, which is a public copy that can be sent off to the Play Store or any other distribution channel of your choosing.
April 24, 2013 By: Mike Szczys
Putting together a killer app is hard enough without having to do everything yourself. That’s where external libraries come in really handy. Whether you need to gain root access to run system commands, need help creating a PDF, or are looking at dealing with files; there’s a resource that can get you there fast. XDA Senior Member Bassie1995 is maintaining a thread of helpful library repositories.
So far there almost a dozen listed, but I image that word will get around and the list will grow over time. The RootTools repo handles the superuser access that I mentioned earlier. This could be used in conjunction with a couple of different file chooser libraries that would make it a snap to add file and folder selection to your app. On the UI side, there are many different packages in the list which take the guesswork out of making your program look and act like you want it to. StickyListHeaders caught my eye as a way to display which section a user is in as they scroll through long lists. StandOut will help you float windows, and ViewPageIndicator will take care of tab display features.
Head on over to the original thread to view the list. Don’t forget to post a reply if there’s a repo you think needs to be added.