Showing posts with label Android. Show all posts
Some of you might know this unofficial Stack Careers Android app which allows you search job in IT sector. There is a link => Stack Careers on Google Play. I have been using it for a while, but some time ago it stopped working. Only what I got was : 'No Results'. So, I downloaded repository and found out that feed API of Stack Careers has been changed. I mean that application got HTTP 301 status which means Moved Permanently and no redirect has been performed using standard HttpConnection component of Android stack. More info about what I did you might find below and under pull request link.
In fact that I have been using you app occasionally, I found someday that it does not work now. I managed to figure out that guys from Stackoverflow changed feed API and moreover you app was not able to follow up redirect (HTTP 301 Moved Permanently).
So, according to this pull request what I did and what I did not :
- feed API has not been changed
- added OkHttp library within required by it another library called Okio
- replaced HttpURLConnection with client from OkHttp
- added required rules for proguard to cover up OkHttp
I also would like to mention that feed API for Stack careers has been changed from
http://careers.stackoverflow.com/jobs/feed => https://stackoverflow.com/jobs/feed
PS. I hope that author of Stack Career will accept my fix for that problem and eventually some day we might be able to download new app from Google Play.
Reference :
[1] Stack Careers - pull request
If you are trying to speed up your Android phone, you should consider uninstalling Facebook! You can read more about that phenomenon for instance here : https://www.reddit.com/r/Android/comments/42kyph/uninstalling_facebook_speeds_up_your_android/. To be honest my phone is much faster after removing Facebook.
I would like to announce that new Android app has been released recently times by me. This time application is called PerlJobs. This application helps you as a Perl developer to find new job opportunities across the globe. Job offers are divided into sections : Standard, Mod, Catalyst, Mason, Telecommute and By Country. The main source of all jobs is website : https://jobs.perl.org
Yes! I finally managed to create it. Obviously it is not so pretty as it might be, but.. never mind :) If you would like to create your own Google Play Developer Page where you can add some promotion text and graphics (icon and background), just go to your Developer Console and then click Settings and then Developer Page. If you are looking for let's say 'inspiration', you can have a look on my Developer Page which link you can find below :
I just would like to show you how setup styles.xml and values-v21/styles.xml to use Material Design with AppCompat. First of all rename styles21.xml as styles.xml and place in your res/values-v21 folder (you may need to create a values-v21 folder if you don't already have one). Below you might found AndroidManifest.xml.
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="uk.co.thewirelessguy.myappname" > <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="uk.co.thewirelessguy.myappname.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
Then change your build.gradle to provide appropriate compileSdkVersion and buildToolsVersion.
apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.1" defaultConfig { applicationId "uk.co.thewirelessguy.myappname" minSdkVersion 9 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.0' }
After that you can apply styles.xml
<resources> <!-- Base application theme. --> <style name="AppTheme" parent="AppTheme.Base"/> <style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <!-- colorPrimary is used for the default action bar background --> <item name="colorPrimary">@color/colorPrimary</item> <!-- colorPrimaryDark is used for the status bar --> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <!-- colorAccent is used as the default value for colorControlActivated which is used to tint widgets --> <item name="colorAccent">@color/colorAccent</item> <!-- You can also set colorControlNormal, colorControlActivated colorControlHighlight & colorSwitchThumbNormal. --> </style> </resources>
And also style for v21
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="AppTheme.Base"> <!-- Customize your theme using Material Design here. --> </style> </resources>
Reference : [1] https://gist.github.com/thewirelessguy/1875ddb114bda7407402
I would like to publish a very useful snipper of code to create cron service in your Android app. Of course you might use some libraries created by other developers. A lot of them might be found on site called Android Arsenal [1] which also I would like to recommend for developers who are looking for libraries.
So, First of all you need to create Handler [2] object which allows you to send and process Runnable objects. This object has a lot of methods which might help you to define expected behavior of your code. This time I will use method postDelayed which allows to execute some Runnable with delay.
private Handler handler = new Handler();
And then we can define Runnable with task in it which should be executed with given delay
Runnable networkReceiverTask = new Runnable() { @Override public void run() { //execute here method with given delay handler.postDelayed(networkReceiverTask, 15000); } };
Reference:
[1] Android Arsenal Job Schedulers
[2] Android Handler
Some of you might be looking for some solution to display progress loading dialog. I have used below example it in one of my Android application compiled against API 23 (Android 6.0). That's why on first glance you might think that style theme which I used in this case is overloaded. You need just to adjust it to your own purposes.
<style name="LoadingDialogTheme"> <item name="colorAccent">#1976D2</item> <item name="android:textColor">#1976D2</item> <item name="android:textColorPrimary">#1976D2</item> <item name="android:textColorSecondary">#1976D2</item> <item name="android:windowFrame">@null</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowIsFloating">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowTitleStyle">@null</item> <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item> <item name="android:backgroundDimEnabled">false</item> <item name="android:background">@android:color/transparent</item> </style>
ProgressDialog progressDialog = new ProgressDialog(MainActivity.this, R.style.LoadingDialogTheme); progressDialog.setMessage(getString(R.string.dialog_loading_content)); progressDialog.setCancelable(false); progressDialog.setCanceledOnTouchOutside(true); progressDialog.show();
And the final result is as this one :
A few days I was looking for some library to parsing RSS feeds in Java mainly for Android purpose. For me it was quite obvious that I will pick up library called ROME because of I have still a pretty good feeling about it from previous projects. Below you can find my piece of code which is very similar to this one on ROME website.
URL url = new URL("https://www.centralbank.ie/Pages/RSSFeedDisplay.aspx?FeedID=20"); SyndFeedInput input = new SyndFeedInput(); SyndFeed feed = input.build(new XmlReader(url)); List entries = feed.getEntries(); logger.info("Size : " + entries.size()); Iterator iterator = entries.iterator(); while (iterator.hasNext()) { SyndEntry entry = (SyndEntry) iterator.next(); logger.info("Entry : " + entry.getTitle() + " " + entry.getAuthor() + " " + entry.getLink()); }
If you will use official ROME library [1] on Android you will be faced with this error :
ERROR/AndroidRuntime(263): java.lang.NoClassDefFoundError: [Ljava.beans.PropertyDescriptor;
This error occurred due to lack of libraries on Android platform related to java.beans package. Fortunately there is a way to parse this RSS on Android platform properly. Only what you need to do is download fork of ROME library called AndroidROMEFeedReader [2] and apply jdom-1.1.1-android-fork.jar and android-rome-feed-reader-1.0.0.jar to your project in Android Studio. From this moment you will be able to fetch and parse RSS without including java.beans package to your project.
Reference: [1] ROME [2] GitHub AndroidROMEFeedReader [3] Docs Oracle Java Beans
Today I have released on GitHub two repositories which contain one of my recent project called TrafficCity. It was developed on hackathon called BIHAPI (Business Intelligence Hackathon API) organized by Orange Poland.
Briefly describing what's it's about in this app - on the mobile app you can place your markers (waypoints) on Google Maps which describes your daily route to work/school. After that you can send those waypoints to server to further processing.
In Backend you can see what's routes are defined by users. Additionally you can upload OSM file which is strongly related with OpenStreetMap and after that you can see on particular area what's is the chance to appear traffic jam.
An application consists of Backend app written in Spring and mobile app written in Android. Application was mainly deployed on JBoss AS 7.1. Backend part is also using interfaces provided by Orange - SIM GeoLocalization API, SMS API, USSD API and by Warsaw City - Transport POI Maps.
Unfortunately, I think that application which is in alpha phase, probably would remain so. There a few things to do/fix on the Backend and Mobile part, but not at this moment. I hope that more appropriate time will come.
Below I allowed myself to post some screenshots from backend and mobile part of this application.
![]() |
Dashboard |
![]() |
Markers |
![]() |
OSM Upload |
![]() |
OSM Projects |
![]() |
HeatMap |
![]() |
Home |
![]() |
Settings |
![]() |
Transport Type |
![]() |
First marker |
![]() |
Multiple markers |
![]() |
Daily route |
![]() |
Settings |
Reference :
[1] GitHub TrafficCity Backend
[2] GitHub TrafficCity Android
[3] BIHAPI
One of my Android applications requires to fetch and process external RSS resource. My first thought was that I should use very useful and well documented library called ROME [1]. Unfortunately I had some difficulties using this library because of there is a lack of java.beans package in Android's Java API implementation [2]. Of course you can fix this issue by installing some missing packages, but I was looking for some out-of-box solution. Finally, I found library called Simple Feed Parser [3]. It may for some of you be quite outdated (last commit was 4 years ago) and I found that there is a some issue with accessing date of single RSS entry, but it has very simple implementation, it is compatible with Android SDKs and it does not require any further library dependencies! Below you can find some example usage of this library in Java.
import com.ernieyu.feedparser.Feed; import com.ernieyu.feedparser.FeedException; import com.ernieyu.feedparser.FeedParser; import com.ernieyu.feedparser.FeedParserFactory; import com.ernieyu.feedparser.Item; try { InputStream inputstream = new URL("http://rss.android.com/rss).openStream(); FeedParser parser = FeedParserFactory.newParser(); Feed feed = parser.parse(inputstream); List- itemList = feed.getItemList(); for (Item item : itemList) { logger.info("Title : " + item.getTitle()); logger.info("Item : " + item.getLink()); logger.info("Description : " + item.getDescription()); logger.info("Date : " + item.getPubDate()); //might be null } } catch (IOException e) { logger.info("IOException : " + e.getMessage()); } catch (FeedException e) { logger.info("FeedException : " + e.getMessage()); }
References : [1] ROME - All feeds lead to Rome! [2] Java.Beans on Android [3] Simple Feed Parser
For some of you I have this very useful command line for getting Android Debug Key which can be used for signing Android applications.
Alias name: androiddebugkey
Creation date: 2014-12-18
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Android Debug, O=Android, C=US
Issuer: CN=Android Debug, O=Android, C=US
Serial number: 32435620
Valid from: Thu Dec 18 21:04:11 CET 2014 until: Sat Dec 10 21:04:11 CET 2044
Certificate fingerprints:
MD5: XXX
SHA1: XXX
SHA256: XXX
Signature algorithm name: SHA256withRSA
Version: 3
Extensions:
#1: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 20 B4 60 1E 46 B5 AD B0 45 49 93 48 C2 D6 0C BF .`.F...EI.H....
0010: 9C CD 8D 02 ....
]
]
Information under SHA1 can be used to signing Android apps. More information about signing Android apps you can find under this link Developer.android.com - App Signing.
When you get this message - "ADB not responding. You can wait more or kill adb ..." just use this command :
I would like only to announce that I have created a small application in Android called Oracle DB 11g Errors Guide. This application helps you as a developer or administrator of Oracle ® Database 11g Release 1 find solutions of problems which you are faced with during your work. Each error message contains the message statement, an explanation of the probable causes and a recommended action.
More information about Oracle ® Database 11g Release 1 Error Messages you can find under hyperlink - Oracle® Database Error Messages 11g Release 1 (11.1) Documentation
Hyperlink to Google Play Store - Google Play Store GarciaPL