Category Archives: Programowanie

[apps] New speedway application for iOS and Android devices

Some time ago i created project for application to watch polish speedway games on mobile devices (link to this post). In meantime owners of website ZuzelEnd.com has contacted me and ask if i’m using their data unofficial way so maybe is to cooperate together and get official application. And hare it is. You can now see first screen shoots from new version of application:

Now we are doing internal tests of this application on Android and iPhone devices and if everything will be finished i will release it to everyone to download and use for free.

All information will be available on this page.

Polish: Jakiś czas temu przygotowywałem aplikację na androida i iphona do przeglądania transmisji z meczy żużlowych. Niedawno zgłosił się do mnie właściciel storny zuzelend.com, z której pobierałem dane z propozycją przygotowania oficjalnej wersji i oto ona, screeny możecie oglądać powyżej. Aplikacja jest w trakcie testów, gdy będzie gotowa udostępnię ją dla wszystkich.

Wszystkie informacje będziecie mogli przeczytać na tej stronie.

 

[New ideas] GTD application – first application sketch

This week company which i work for has organized training of Usabilit and UX which was provided by Witflow company. It was one of the best training i ever had and give me lot of new ideas how to improve my work as a software developer, and – what i think is even more important – how to present my ideas about new software to users. One of this ideas was to make sketches of application when you can show user how does application will look like and also i can make my ideas real.

To make useful exercise of sketching i decided to make a little more real my idea of having simple GTD application for me and few close friends.

So here is my sketch:

GTD

After spending some time on sketching i realized myself few interesting things:

  • it is much easier to show something on sketch then trying to tell about
  • if you are sketching something you can very easy verify your ideas and see is something is missing and fix it
  • it is good to watch your sketch in few zoom options

So right now my idea is a little bit real, only what i need is time to develop it

[SAP JSON proxy] First public information – BAPI calls and SE37 HTML equivalent

Today i finally prepared test environment for SAP JSON proxy and i’d like to present all of you some of ideas.

First – why this project?

Right now i’m working on few applications which works with SAP but all of them are .net apps and fat client.  Because i’m last time fascinated web and mobile programming again i was wondering how to easy build simple applications interacting with SAP. Usually it was quite easy – i was building web service which was exchanging data with my application. This was good idea and everything was working really nice and smooth, but problem was that first i have to do something on server and then in my app (web or mobile). Then i asked myself what if i will simply put universal application on web which will somehow understand some queries from my app and then will execute my calls on SAP and return data back.

I was wondering about exchanging data in xml but json seams to be better so i decided to use json.

How it works?

application is sending json object with definition of process which want to call on SAP, then proxy analyze this object and prepare RFC call for SAP. After call is executed and return is converted to json and send back to application.

What are benefit so this approach?

First of all – you don’t need to care about any special sap connectors for web and mobile devices. Second you don’t need to care about server side any more, you have to focus only on side of your application. Third it is secure because applications doesn’t have any direct access to SAP server so you can extend proxy by adding some security filters or limitations on calls

So now an example

Example works on bank accounts settings. On SAP we have BAPI_BANK_GETLIST bapi which looks this way:

sap1

it expect import parameter BANK_CTRY – which in our example will be PL and returns BANK_LIST table which in our example looks this way:

sap2

As you can see there is one row with one example bank.

my JSON query looks this way:

{ "bapiName" : "BAPI_BANK_GETLIST",
 "errorMessage" : "",
 "exportFields" : [ { "name" : "BANK_CTRY",
 "value" : "PL"
 },
 { "name" : "MAX_ROWS",
 "value" : "0"
 }
 ],
 "exportStructures" : [ ],
 "importFields" : [ ],
 "importStructures" : [ { "fields" : [ { "name" : "TYPE",
 "value" : " "
 },
 { "name" : "ID",
 "value" : " "
 },
 { "name" : "NUMBER",
 "value" : "000"
 },
 { "name" : "MESSAGE",
 "value" : " "
 },
 { "name" : "LOG_NO",
 "value" : " "
 },
 { "name" : "LOG_MSG_NO",
 "value" : "000000"
 },
 { "name" : "MESSAGE_V1",
 "value" : " "
 },
 { "name" : "MESSAGE_V2",
 "value" : " "
 },
 { "name" : "MESSAGE_V3",
 "value" : " "
 },
 { "name" : "MESSAGE_V4",
 "value" : " "
 },
 { "name" : "PARAMETER",
 "value" : " "
 },
 { "name" : "ROW",
 "value" : "0"
 },
 { "name" : "FIELD",
 "value" : " "
 },
 { "name" : "SYSTEM",
 "value" : " "
 }
 ],
 "name" : "RETURN"
 } ],
 "result" : "OK",
 "tables" : [ { "columns" : [ "BANK_CTRY",
 "BANK_KEY",
 "BANK_NAME",
 "CITY"
 ],
 "name" : "BANK_LIST",
 "rows" : [ ]
 } ]
}

and proxy response is this:

{ "bapiName" : "BAPI_BANK_GETLIST",
 "errorMessage" : "",
 "exportFields" : [ { "name" : "BANK_CTRY",
 "value" : "PL"
 },
 { "name" : "MAX_ROWS",
 "value" : "0"
 }
 ],
 "exportStructures" : [ ],
 "importFields" : [ ],
 "importStructures" : [ { "fields" : [ { "name" : "TYPE",
 "value" : ""
 },
 { "name" : "ID",
 "value" : ""
 },
 { "name" : "NUMBER",
 "value" : "000"
 },
 { "name" : "MESSAGE",
 "value" : ""
 },
 { "name" : "LOG_NO",
 "value" : ""
 },
 { "name" : "LOG_MSG_NO",
 "value" : "000000"
 },
 { "name" : "MESSAGE_V1",
 "value" : ""
 },
 { "name" : "MESSAGE_V2",
 "value" : ""
 },
 { "name" : "MESSAGE_V3",
 "value" : ""
 },
 { "name" : "MESSAGE_V4",
 "value" : ""
 },
 { "name" : "PARAMETER",
 "value" : ""
 },
 { "name" : "ROW",
 "value" : "0"
 },
 { "name" : "FIELD",
 "value" : ""
 },
 { "name" : "SYSTEM",
 "value" : ""
 }
 ],
 "name" : "RETURN"
 } ],
 "result" : "OK",
 "tables" : [ { "columns" : [ "BANK_CTRY",
 "BANK_KEY",
 "BANK_NAME",
 "CITY"
 ],
 "name" : "BANK_LIST",
 "rows" : [ { "values" : [ { "name" : "BANK_CTRY",
 "value" : "PL"
 },
 { "name" : "BANK_KEY",
 "value" : "TESTPL1"
 },
 { "name" : "BANK_NAME",
 "value" : "Test bank pl"
 },
 { "name" : "CITY",
 "value" : "test"
 }
 ] } ]
 } ]
}

And this is how it looks in my HTML tester page which works similar to SE37 transaction

sap4

 

And here is another example:

Details of this bank account:

sap3And my data

sap5

This is current stage, if you have any questions for this project, then please let me know in comments or send an email.

 

[Web apps] Voli.Faktury

If you have a small company in Poland and you need to create an invoice sometimes maybe you are looking for an simple and easy tool when you can do this from web.

I also have this problem, but because i’m a software developer, i don’t like to use existing software and i like to do something my own. Specially if there is good occasion to build something interesting and test some exiting technologies 😀

So i did invoicing software which is available here and here is a screen.

faktura

In this tool you can create your invoice, save it and use it later. You don’t need to create database of clients or products, because if you want to create an invoice for someone who you already did just copy this invoice and paste it in new one. Idea is to have as less functionality as possible and make it to use as easy as it is.

Because it is still in beta stage, if you will register and want to use it, then let me know this because i need to know if i should care about your data.

Ok, some technical information. Here is done some of my favorite (for now;)) software technic and i did something what i personally call “onion programming”. We have following liers:

1. Data – data are stored in NoSQL Document database called Ndatabase. It is easy and great solution for embeded concept – just one library try it!!!

2. data access lier is ASP.NET MVC 4 application

3. data exchange lier it is JSON communication

4. data presentation lier is HTML with Bootstrap and jQuery

5. data binding is MVVM model supported by Knockout-js – great option if you have an experience with WPF or silverlight. Using Knockout and jQuery programming web applications is so easy as building fat client applications in WPF or WindowsForms.

If you have any technical questions or suggestions to this project, please let me know and i will try to answer you.

 

[iOS app] MaxVideo.pl client application

Since some time in App store you can find and test my client application for MaxVideo.pl service.

This service is video storage service where users can store their own movies and can share this movies to friends by sending direct link to it. Web site policy is to do not have any search feature because all files are private users files and only users can decide who can or who can not watch their movies.

I wanted their movies for my different and private project so we made a “deal” they will give me access to their api and i will make an application for them.

So now if you have our own movies on MaxVideo or you have friends who store movies there you can watch it directly on your iphone or ipad. Only what you need to have is valid account.

Application is available for free in App Store – have fun and leave comment if you want 🙂

In this project i used may favorite technology (for now) for programming mobile devices – it is combination of PhoneGap, jquery and jquerymobile.

20130213-213631.jpg

If you have an android device and you want to use this application on android you can try this apk. I don’t use android any more so i don’t know if everything is working ok, but this is compiled PhoneGap project for android with my app, so feel free to test it and let me know if it works or not.

 

[New ideas] second approach to shopping presentation software

Second version of my idea about shop presentation software. This time it is small parser of web shop of polish H&M, Just go there and hit F4 and put H&M product number, Or – this is coolest – scan QR code with your mobile phone and you can select one of few example codes to display. Have fun 🙂
Only one note – remember it is still prototype and only a presentation of idea.

Here is link to find and test this software

Zrzut_ekranu_08.02.2013_20_10when you will open mobile application just select one of example article numbers and information of it will be shown for 10 seconds on monitor screen remotely

Here is how mobile page looks like.

20130209-213934.jpg
When you will select category from main menu then you will see products from this category.

20130209-213945.jpg
Now you need to select product which you want to see on big screen.

Of course your “big screen” can be whatever from 80 inches TV set to iPad.

Plan lekcji na iPhone już trafił do App store

Od jakiegoś czasu pracowałem nad odświeżoną wersją mojego programu do planu lekcji i dzisiaj w końcu trafił on do App Store.

Mamy nowy design in nową funkcjonalność, więc tutaj krótka lista co teraz program potrafi:

  • Obsługuje dowolną liczbę uczniów (dzieci)
  • każdy z uczniów może mieć zdefiniowany dowolny plan godzin lekcyjnych (kiedy lekcje się kończą lub zaczynają)
  • przy tworzeniu planu lekcji na konkretny dzień można rozpocząć od wstawienia standardowego planu godzin i wtedy tylko wypełnić już kolejne lekcje, a niepotrzebne godziny usunąć
Teraz kilka screenów z aplikacji:
Czekam na wasze opinie, komentarze i pomysły co by tu jeszcze zmienić.

Iphone Contact Exporter

Wczoraj pojawił się mały problem. Michał kombinował jak by tu wydłubać kontakty z Iphone ale jednocześnie nie synchronizować go z niczym. Pomyślałem, że dobrym pomysłem byłoby wyeksportowanie kontaktów do pliku CSV i przesłanie ich mailem. Potem można już z tym zrobić co się chce.

Napisałem więc prostą aplikację i wrzucę kawałki kodu źródłowego, bo może ktoś jeszcze będzie chciał z tego skorzystać.

Na początek importy:

Dla dostępu do książki adresowej potrzebujemy:

#import <AddressBook/AddressBook.h>
#import <AddressBookUI/AddressBookUI.h>

Do wysłania emaila będziemy potrzebować jeszcze:

#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>

Dodatkowo trzeba dodać w deklaracji naszego view controllera obsługę protokołu <MFMailComposeViewControllerDelegate>

Kod do importu książki adresowej wygląda tak:

- (IBAction)Import:(id)sender {
    ABAddressBookRef ab=ABAddressBookCreate();
    CFArrayRef people=ABAddressBookCopyArrayOfAllPeople(ab);
    CFIndex ii=ABAddressBookGetPersonCount(ab);
    NSString *wszystko=@"";
    for(int i=0;i<ii;i++)
    {
        ABRecordRef record=CFArrayGetValueAtIndex(people, i);
        NSString   *FirstName=(__bridge NSString *)ABRecordCopyValue(record, kABPersonFirstNameProperty);
        NSString   *LastName=(__bridge NSString *)ABRecordCopyValue(record, kABPersonLastNameProperty);
        NSArray *Email=(__bridge NSArray *)ABMultiValueCopyArrayOfAllValues(ABRecordCopyValue(record, kABPersonEmailProperty));
         NSArray *Phone=(__bridge NSArray *)ABMultiValueCopyArrayOfAllValues(ABRecordCopyValue(record, kABPersonPhoneProperty));

        NSString *outputRecord=[NSString stringWithFormat:@"%@; %@; %@; %@\n",FirstName,LastName,[self arrayToString: Email],[self arrayToString: Phone]];

        wszystko=[wszystko stringByAppendingString:outputRecord];
    }

    [OutputContactList setText:wszystko];
}

Zaimportowane kontakty z będą zapisane jako tekst oddzielany średnikami – po jednej linii na kontakt. Importuję tylko pola: imię, nazwisko, wszystkie numery telefonów i wszystkie adresy e-mail.

Na końcu przygotowane dane wrzucam do TextView OutputContactList

W związku z tym, że numery telefonów i emaile są przechowywane w tablicy zrobiłem sobie jeszcze jedną pomocnicza funkcję:

- (NSString *)arrayToString:(NSArray *)ar
    {
        NSString *s=@"";
        int i=0;
        if([ar count]>0)
        {
        for(NSString *pozycja in ar)
        {
            i=i+1;
            s=[[s stringByAppendingString:pozycja] stringByAppendingString:@";"];
        }
        }
        for (int j=i;  j <= 3 ;j++)
        {
            s=[s stringByAppendingString:@";"];
        }
        return s;
    }

Przekształca ona tablice na ciąg 4 elementów oddzielanych średnikami – jak tablica jest mniejsza to dopełnia ją – zakładam, że nie będę miał więcej numerów telefonów lub adresów email.

Pozostaje jeszcze wysłanie emaila z danymi:

- (IBAction)sendMail:(id)sender {
    MFMailComposeViewController *mailController=[[MFMailComposeViewController alloc]init];
    [mailController setMailComposeDelegate:self];
    [mailController setMessageBody:[OutputContactList text] isHTML:NO];
    [mailController setSubject:@"Sending contacts"];
    NSArray *recp=[[NSArray alloc]initWithObjects:[emailAddress text], nil ];
    [mailController setToRecipients:recp];
    [self presentModalViewController:mailController animated:YES]; 
}

Ten kod otworzy okienko i przygotuje e-mail do wysłania.

Pozostaje jeszcze obsłużenie zamknięcia okna:

-(void ) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
    [controller dismissModalViewControllerAnimated:YES];
}

I właściwie gotowe.

Efekt końcowy u mnie wygląda mniej więcej tak:

 

Jeżeli macie pytania to zapraszam do komentowania