Showing posts with label android. Show all posts
Showing posts with label android. Show all posts

Thursday, 2 February 2017

Development : Phone Link

I wonder around all day with an Android phone in my pocket, however, I can't always answer it... "No Problem" I can hear you cry "leave it to go to answer phone".

However I purposefully have no answer phone, if you can't get a hold of me, you can't get a hold of me, but what I would like is a method of receiving a message which I can digest in my own time, not a voice mail, not a text message, I want to be able to have left my phone at home and still get the information from it that I've had a call....

I'm a developer... I can do this right?!!??!

Well, yes and no, first of all I started with a Java Application which would read the missed calls log and forward it to one of my servers, this worked, but didn't let the person at the other end know I had been made aware of the missed call, it also logged junk mails and just gave me the number.  If I didn't recognise the number I could be left lost.

So, I set about a but of middleware, I had the missed calls log forward to my server every few time it changed, the server then looked up each number on a white list and a black list.  If found on the white list is looked for them in contacts and sends them an automated message that I had received a missed call and to e-mail me...

Fine for contacts.

Last week however I went a step further, if a number is not black listed it looks them up as a contact then if not found it googles for them and looks scrapes the top ten results.  E-mailing the number and these search results to me.

I've today added a series of regular expressions to pattern match any number or name from the results, and if more then two match it flags it as a contact and googles for them, finding an e-mail address is the target... It will go to my various e-mail addresses and alias, looking for previous missives and will send them a mail that way.

The person has to have had a contact with me, this is not blindly spamming people, and I had had to use a POP3 connection to one of my own email providers as Virgin Media stop SendMail from just working... But, so far it's worked.

Today alone I've had nearly eighteen calls, and it's sent about five messages today, since last night (when I started it) it's send just over twenty in total....

I dub this "Phone Link" for Android, and I may very well push it out to the world if I can polish it up a little and not have it so closely bound to my various e-mail services.  What do you all think?

Monday, 15 August 2016

Programming : My Thoughts on Kivy

About a year ago, I had to work on Python, suddenly and without warning.  And though I had tinkered with python I neither listed it in my arsenal of programming languages nor thought myself conversant enough in it to deliver a product.  But the powers that be said "he's the linux guy, this is python, we don't want it on Windows, give it him".

So there I was, Python on the Linux server and Python on the Android phone... Two parts of the same project, and they needed a nice UI.

Now I don't know Qt at all, I've used it, never been terribly impressed (though that opinion is for another post and is highly subject to change) with the look of it.  So I set about looking for alternatives.

The alternative I found, which worked best for me, was Kivy.

I found the syntax a little awkward, and the actual creation of the recipe for the WI was very awkward at times, finding what inherited where being the main problem, it was a little.  Well it was a little counter intuitive to say the least, but it worked.

And the product went out there looking black and sleek and cool, and it was on everyone's Samsung smart phone at the launch meeting, and I was quite proud I'd managed it, and Kivy was the key in that delivery.

It has been a year since I created that application, a year of waiting for any feedback, it was a demanding time to get stuff floated and out to users.  I hope they liked it, I certainly did.

Android - Python - Kivy... Pretty much my go-to platform for Android development.

Wednesday, 9 September 2015

Remember Remember to Blog in September

Sorry I've been away so long, but I've been very very busy, in the office I've had a paradigm shift in my projects, away from coaxing old C# systems and writing little C++ items to developing for Android.

I've therefore had to set up, and document, a whole manner of working with a new set of devices on an OS most of the folks in my office don't want to acknowledge, no not Android... Linux... They line Android... But detest and hate seeing Linux.

Yes, yes I know Android is Linux, and I know you know... But you tell some of the folks in my office, and the ones who don't have an opinion generally have an iPhone stuck to their ear.

So, developing for Android... I must have been doing Java eh?... Nope... Remember I said I was into Python, well I've been developing Python for Android, I've learned the languages, got to grips with Kivy and used buildozer to create my APK's for distribution to the devices.

I've dabbled with PyJNIus as well as other Android API libraries.

I will be bringing some tutorials to these pages about all this, once I've gotten the project itself completed.

My current challenge is animation of the active pages within the Application with Kivy.

Thursday, 13 August 2015

I'm into Python

This week has been an interesting week for me, as I have, for the first time in about three years, began to learn the ins and outs of a new programming language.

This language is Python.  I've heard a lot about python, it's use at google, it's use by those who are on the sharp end of internet based development, but whom want to remain serious programmers.

Now, of course, I'm an old style programmer, and I like my code to communicate to me exactly what it's doing, so the first problem I've had with Python is it's use of white space as code flow control.  This is perhaps my biggest bug bare with the language, it totally grates me, and there are ways around it, using perhaps a semi colon to close a class, or an if statement, or simply to indicate that the current stanza/block of code is about to end, rather then using indentation to indicate this.

This particular problem is put into great focus on Python for windows, when loading Idle (the IDE supplied) and it constantly starts to moan about unexpected uses of spaces or indentation... You can literally pull your hair out over this, but that's a bug in that editor not the language.  The language just shows up the problem.

The power of the language though is strong, string editing, numerics, you have a C power straight out of the box, exploring the libraries like urllib and you have extremely simple (2 lines of code) methods to download files from the internet.

Within 200 lines of code I had a working application, which would trawl a website following all the links and listing them.  It's clearly very powerful and not as I had feared a toy language.

One frustration is getting a GUI working, there are perhaps too many options and nothing solid to follow in order to get an interface running.

I'll keep you posted, perhaps I'll come back with some Python code soon enough.