Tuesday, August 19, 2014

Android Slack send message example (Incoming WebHooks)

In slack, click "Configure Intergrations" and "Incoming WebHooks"
Create your application and "Incoming WebHooks" url with token.


Put "getInstance()"




/*
 * Made by ShakeJ (shakejj@gmail.com). Send message to slack's channel. Use
 * 'Incoming WebHooks' http://mnworld.co.kr Search 'ShakeJ' in google play :)
 */

public class SlackMessageUtil
{
  protected String siteUrl;
  private volatile static SlackMessageUtil uniqueInstance;
  
  
  private SlackMessageUtil(String incomingWebHookUrl)
  {
    this.siteUrl = incomingWebHookUrl;
  }
  
  
  public static SlackMessageUtil getInstance(Context context, String incomingWebHookUrl)
  {
    if (uniqueInstance == null)
      synchronized (SlackMessageUtil.class)
      {
        if (uniqueInstance == null)
          uniqueInstance = new SlackMessageUtil(incomingWebHookUrl);
      }
    return uniqueInstance;
  }
  
  
  @SuppressWarnings("unchecked")
  public void sendMessage(String channel, String message, String name)
  {
    JSONObject obj = new JSONObject();
    
    try
    {
      obj.put("channel", channel);
      obj.put("username", name);
      obj.put("text", message);
    }
    catch (JSONException e)
    {
      e.printStackTrace();
    }
    
    List params = new ArrayList();
    params.add(new BasicNameValuePair("payload", obj.toString()));
    new RequestAsyncTask().execute(params);
  }
  
  private class RequestAsyncTask extends AsyncTask, Integer, Boolean>
  {
    @Override
    protected Boolean doInBackground(List... params)
    {
      boolean result = false;
      try
      {
        DefaultHttpClient client = new DefaultHttpClient();
        HttpRequestBase requestBase = null;
        
        requestBase = new HttpPost(siteUrl);
        ((HttpPost) requestBase).setHeader("Content-Type", "application/x-www-form-urlencoded");
        ((HttpPost) requestBase).setEntity(new UrlEncodedFormEntity(params[0], "UTF-8"));
        HttpResponse response = client.execute(requestBase);
        
        if (response.getStatusLine().getStatusCode() < 400)
          result = true;
        else
          result = false;
        
        Log.w("WARN", "Send message to slack result : " + result);
      }
      catch (Exception e)
      {
        e.printStackTrace();
      }
      return result;
    }
  }
  
}

Tuesday, August 5, 2014

Android Wear music application 'Wear Music'

It is compatible with Android Wear.

Wear Music

Maybe Hear the music of the day that most of do with smartphones.
This app support more easily control your music with Wear.

With 'play', 'stop', 'pause', 'next track', 'prev track' control music and
'Volume up',  'Volume down'.

Select the app you are running 'Start' - 'Wear Music' in Wear. (Or Wear music start voice command)

To wear and send an alarm, you can control the music coming through the current song information, and Action. (To be updated)

https://play.google.com/store/apps/details?id=com.shakej.wear.music




Tuesday, February 18, 2014

Best Redmine Android application 'mintRedmine'

https://medium.com/p/53a10ad08930




Formal Introduction

to mintRedmine




WRITTEN BY






This Thursday, 20th Feb 2014, we will launch mintRedmine, our new mobile application for Android.
Before we finish our final stage, I want to take some time to introduce every detail of our application.

Full Functionality




ADD / EDIT SITE VIEW

When we started to make an app for Redmine, the first mission was to make it complete for basic usage because if we need to resort to the Redmine webpage, then, we need to switch from our app to the webpage frequently, and that would make our app useless in the end. So, we collected use cases for routine tasks, and then we tried to make it so that they could be done without leaving our app.



PROJECT LIST VIEW

We used Redmine’s API wherever possible, but if the API did not support what we needed, then we parsed the webpage’s HTML. But we did not want to parse every webpage because there would be a risk of not working after Redmine’s upgrade. So, we tried our best to stick to the API, unless other features were absolutely necessary.



ISSUE LIST VIEW

And also we made our app look similar to the Redmine webpage. So, people who have used the webpage before, can use our app without having to relearn how to use it.



ISSUE DETAIL VIEW

And we did not make any custom UI components. We only used standard UI components. So, Android users can feel at home.



NEWS VIEW

It contains Activity, Roadmap, Issue List, Watched List, News, and Wiki Page tabs for each project. And for every site, there are Activity, Projects List, Query List and News tabs.



LIST OF ROADMAP VIEW
ROADMAP VIEW

Textile / Wiki




WIKI PAGES

It was not very hard to show project and issue information on our app. But, the problem was that all the content of the issue is written in textile format. So, if it showed its content as in its raw format, then I felt I did not want to use it. So, we decided to tackle this in a little bit harder way. We tried to convert textile format to styled text.
We developed a textile parser by ourselves. It is not perfect yet. (It does not support table format) But it supports most of its syntax, so the description and history of an issue look just the same as the webpage. We applied it to the wiki pages, so we can move from the issue pages to the wiki pages without leaving our app.

Custom Query Support(with Grouping/Search)




CREATE/EDIT CUSTOM QUERY

When we first made our app, it was very hard to find a specific issue. Redmine webpage itself is very notorious for its issue listing. But, it has a very powerful Query system instead. So, with the help of queries, users of Redmine can easily find any issue they want.



ISSUE LiST CAN BE GROUPED

So, naturally, we brought this Query into our app. Our app can use the Query you created on the webpage, so it shows the same list as the webpage. And it also shows the list in a grouped format (and I’m very proud of this feature).
You can also make your own custom query on our app. (But this query can not be saved on the server) You can create a query the same as you do on the webpage.

Issue Creation/Update




UPLOADED IMAGES CAN BE EASILY INSERTED

After we were very happy with issue browsing and searching, we shifted our focus to issue creation. The first thing we wanted was to add notes to the issues. And because we were making a mobile application, we wanted to take a snapshot of the screen and upload it to the system. So, we created a system that supports file upload. But, when we uploaded a picture and put the picture file name into the note, it was very hard to remember the name of the picture. So, we put the uploaded image selection box into the note area, and it became very easy to insert an image tag into the note.



ISSUE CREATE/EDIT VIEW

Moreover, we created an issue creation and update feature. You can create an issue with every field. And also, it supports custom fields.

Quick change

With time we realized that we were only changing one field of the issue quite often. So, we turned every field on the issue page into a button, so if you touch the button of one field, then you can change that field value only. We found that this feature was very convenient.



ONE FIELD CAN BE EDITED DIRECTLY

Activity / Notification




ACTIVITY VIEW

We wanted to make our app useful not only on the road, but also beside our computer. At this time, we want our app to be a second display of the Redmine webpage.



NOTIFICATIONS SHOW UP

It fetches the Activity feed every 5 minutes and shows it on the app screen. It also shows a popup display of notifications when we are viewing other pages.
In addition, we wanted to implement some kind of push notification for Redmine. But, this required server modification. So, we used the Activity feed to simulate push notification. When you are not using the app, and there is new activity in the feeds, then it can be configured to notify you.

Widget





Because it is an Android application, we wanted to support Android-specific features. But we didn’t want to overdo it. The widget was the very thing we were looking for.
It was a very good solution for Activity viewing.

Time Tracking

When I first wanted to make an application for Redmine, a Time-Tracking feature was the first thing I wanted to make. It was very hard to measure the time I spent on a specific issue. So, I needed an app to count time for me.
So, we attached a Time-Tracking feature to our app. We labeled it as a Pro feature. We did it not because it is very sophisticated or very hard to implement. We didn’t want our app to be completely free. We didn’t want donations. We wanted to make a commercial app. We wanted to make money from this app. At the same time, we didn’t want to make the mistake of annoying our users for monetization reasons. So, this is our tiny banner saying that this app is not totally free, and you need to pay money for full usage. Of course we have plenty of plans for future features for the Pro version.

Custom Font Setting





Because this is an Android application, it will need to run on many different kinds of devices. We tried our best to make our app look pretty neat on every device, but it was slightly bigger or smaller on each device. And every person had different preferences.
So, we created custom font-size settings to allow users to change the font size, so they can adjust the view they want.

Issue List with Custom color





Even though we support custom queries when we are browsing the list of issues, it was not comfortable for skimming through issues.
So, we added custom color schemes for Statuses and Trackers. Users can choose their favorite color for each status and tracker, so they can easily pick out an issue with the specific status or tracker they are searching for.
Like us on Facebook : mintRedmine
Follow us on Twitter : @mintRedmine
Google+ Community

Thursday, December 5, 2013

Android Textile Textview(Markup Textview) like 'redmine' 'github', etc




This library (Textile textview) is open source.
Link here. https://github.com/ShakeJ/Android-Textile-MarkUp-TextView

This textview change markup string and display it.

Textiletextview.setTextileText("markup-string");

very easy.






You download demo application.
https://play.google.com/store/apps/details?id=com.shakej.textile.textview

Wednesday, November 13, 2013

Android library 'Caffeine', Try use it!



 Android programming is the moment when you need more API or function.

I thought.
Simply awful lot from the library simply be able to use the API, you would be awesome?

Like 'caffeine'.


'Caffeine library' is very various utility.
Image, File, Geo, Gesture, Network, Preference, Convert, Date...etc!

Why is the name of caffeine built, very friendly and very necessary because! (As well as people who do not drink coffee by the library, but people do not need)

When you programming, It is very helpful.

This library is open source in github.

try use it:)

https://github.com/ShakeJ/Android-Caffeine-library

Bluetooth remote control Android application - Auto tethering added!



Bluetooth remote control (Bluetooth Remote Controller)
- Devices to control each other ( if the tablet app required !)



Do you have two Android devices?
Phone to surf the Web while listening to music with a tablet , smartphone, I want to hear the next song button is pressed again turning bother to find right?
Tethering tablet to phone when connected by Wait a minute do not you bother turning off tethering ?
Facebook message came back to the phone phone is this?
Sure she puts away the phone when the phone Shoot !

Don't worry
Bluetooth remote control can help.

Features :

- Android 2.x Version Support
- Auto-tethering ( tablet screen is on/off, stop tethering on/off in phone)
- Music Remote Control functions ( play, pause, stop, previous track and then move the volume control )
- Camera remote control function ( shot, front and back switch)
- Camera remote control function ( shot, front and back switch)
- Find my phone ringing at the basic features vibration and unconditional
- Silence camera / camcorder features silent ( app can work alone )
- SMS when receiving confirmation from tablet - will be updated
- SNS ( Kakao Talk , mapeul , etc.) upon receiving confirmation from tablet - will be updated

In addition, many of the features will be continually updated.

How to use :
- To connect two devices to install the app .
- Both devices , click the Options button and then "Make Discoverable" click .
- Connect a device at the other end of the device , click the "Scan" Select the device to connect through .
- Connected on the right pops up connection is successful.
- Fun to control !


Instructions :
- Some devices may not be supported .
- If the music does not play music playlist play one song after the normally work.
- Connect from one side to the other devices and should not normally Connect, the connection may be.
- Silence camera, camcorder, illegal use of it is the user's responsibility .

Support for the paid version of the app shakejj@gmail.com abuse please.
+ About multilingual translation help would be appreciated.
Introduction paid version : http://mnworld.co.kr/1564