Tag-Archive for » g1 «

Now there is a new application for every woman who would like to track her Period and Ovulation. I know there are several applications on the Android Market, but I promised to my wife to write my own version and make it a little bit different than that what was already available for the G1 Mobile.

  • Speciality:
    A full month calender where you can see all your special days (“My Days”) in an graphical overview. Just with a fingertip you are able to add a new “Start of Period”.
    Now all upcoming Periods and Days of highest fertility are calculated for the Future. It is just safer to plan your next holiday or trip, knowing if you will have your days in that time or not. Maybe you are planing to make your baby while you are in vacation, just have a look if your Ovulation happens in that time.
    .
  • Extras:
    You may not only Track your Period, its easy now to keep in Mind when you had last Time Sex or when you took your Pill. All this additional Informations make it comfortable to have all important days tracked with your Mobile Phone.
  • Users:
    Some Woman really have fun to share there Application with her best Friends (if they dont have an own Period Calculator), or within the Family (Mother, Daugther)
    ..
  • ListView:
    Should u like to see just all your Entries in a Listview, also thats possible just by a Click.
    .
  • It’s FREE !!
    This Software does not cost you a Cent. If you like to donate my Work, you are Welcome :)
    .
  • Where do I get this Application?
    http://www.guruk.com/android/mydays03a.apk
    .
  • How to install?
    I am working on to get my Google Developer Account soon as possible to post it in the Market. For now you can download and install the Software “Apps Installer” from the Market. Put “mydays03a.apk” on your SD-Card and run the “Apps Installer” to install this File from your SD-Card
    .
  • What else…
    This is a Alpha Version, so please understand if its not perfect and I am willed to improve with your Help and Response.  Feel free to send your constructive Critics in the Comments, also any positive Comment is welcomed to see if it works with you. Also if you like to help with a translation in any foreign language or even improve my English (i am original german), just send me a Note.

Now, just start to download your “My Days 0.3a”:
http://www.guruk.com/android/mydays03a.apk

Enjoy this Application …. and dont forget, I am not responsible or anything that happens while you use this Program. The final Responsibility is always on yourself :)
.
All the Best and have a great Day
Yours Chris

Hi,

today I got my commercial API from Orb (thanks to Orb).

Now I am able to share with you my little App I wrote for Android.

—- Info

With this Application ( i called it Androrb) you may request your media list that is stored on your pc from the orb server and open a video, audio, webradio or photo on your Android G1 Mobile.

Its still Alpha and there are several things to improve. Please keep in mind this is just a hobby from me and the only reason I give it into the public is to share my joy that I do not need to login by browser into orb, just to listen my music.

— Where to get the Pre-Version?

Here you find the Alpha Version to install on your G1.
http://www.guruk.com/android/androrb03a.apk

You can install this APK with a Tool you find in the Android Market called “Apps Installer”

When you open it first Time you have to enter your ORB UserID and Passwort.

I am only able to test this Version with WIFI on a G1 RC33 . So I am glad you send me your response and experience in your Environment.

—— Develop with me

Should you like helping in development, you may have a look on: https://developer.orb.com/wiki/Main_Page

There you find how to access the API and what commands are possible for he XML Response.
For example:
1. https://api.orb.com/orb/xml/session.login?apiKey=evcphjpgribp&l=myorbid&password=myorbpw
creates a session Key

2. https://api.orb.com/orb/xml/media.search?q=mediaType%3Dvideo&groupBy=author
now we request all Videos.

You may construct and explain XML Feeds you need and I can implement them by time.

—- Finaly :)

All the best and Enjoy.

Yours
Chris

—some pics:

http://www.guruk.com/android/1-registerdata.jpg
http://www.guruk.com/android/2-about.jpg
http://www.guruk.com/android/3-login.jpg
http://www.guruk.com/android/4-showfolders.jpg
http://www.guruk.com/android/5-listcontent.jpg
http://www.guruk.com/android/6-loadmedia.jpg

Category: android, coding  Tags: , ,  17 Comments

Dear Friends,

I was reading a lot about Orb and how great it is to stream Media direct from my PC to my Mobile.
Anyway I did not found an APP for my Android G1 and as I was reading there is no APP from ORB to expect till June.

As I am a Coder I was unable to wait. Especialy I am a Newbie in learning Android (usually PHP COder), that was a little challenge for me to do.

Finaly I got a small Version to work that I like to share with you. Its not at all a real Orb Client as you may expect, but it works for me to scan for all my Video Media that I shared in my Orb, let it display in a Listview and when I click on one of the Titles it starts playing :)

Btw. I was only able to test it with a WIFI Network.

There are several improvments to do. Like:
- a selection for Audio, Photos, Documents, Playlists …
- a Thread that the loading happens in the Background
- a Setup Feature to store and change Userid, Password and APiKey.

But as I make it opensource you can help to improve it.

The most work for me was to understand and test out the API Function from ORB.
Also when there is a API Description from ORB http://developer.orb.com
it was not always really understandable how to do.

You may like to change the Code as you like. Remember when you publish it into the Market
you need a Commercial APi Key from ORb. Yes, I know on Orb is written you need a Commercial Key when
you like to make Money from it or it is business in any other way. Finaly I thought to make it freeware
but after I nice Talk with Luc Julia from Orb he told me: “Remember that you can’t distribute an application using a developer key, it will be invalidated. You need to get a commercial key for that purpose.”

I asked 3 Times but at all it looks for any Case you publish it you need commercial key.

Ok, here is my Prework and I hope you can use it for your Purposes.
Btw: I called it “OrbAnd” :)

You can download the full OrbAnd Source here (prepared for SDK1.1 and Eclipse)

Yours
Chris

–Orband.Java


/*
 * OrbAnd 0.1 Alpha
 *
 * Copyright (C) 2009 Christian Albert Müller
 * http://www.christian-albert-mueller.com
 *
 * This Source Code is Freeware, OpenSource as you like to call it.
 * I do not take any responsibility for its usage and also I dont have
 * Time to explain the Source.
 *
 * If you like to Develop this Version you are welcome to send me your
 * Updates and I will check them and keep the right to publish it for
 * other Users on my Page.
 *
 * If you can make some Explanations for other Users may be helpful.
 *
 * Should you distribute this Version you need a Commercial Key from Orb
 *
 * I am not related with ORB and its not an official Work from ORB
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * You can extend this Copyright with your Changes and keep Responsible
 * for your Work.
 *
 *
 * To start:
 * - go to: https://mycast.orb.com/orb/html/createAPIKey.html
 *   - Enter your ORB Login and request an Developer API Key
 *   - Enter your Login, Password and API Key into the Source Code Bellow
 *   - Compile the Source ... and Enjoy Orb on your Android Mobile :)
 *
 * Infos about Error Codes and XML Requests at: http://developer.orb.com
 *
 */

package com.development.orband;

import java.io.BufferedInputStream;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.HashMap;

import org.apache.http.util.ByteArrayBuffer;
import org.apache.http.util.EncodingUtils;

import android.app.ListActivity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

public class Orband extends ListActivity
{
	/** Called when the activity is first created. */

	private static final String TAG = "Orband";

	String Username = "yourUsername";
	String Password = "yourPassword";
	String apikey   = "yourApiKey";

	String html;
	String dummystr;
	String sid;

	//Initializing the ListView
	private ArrayAdapter<String> mAdapter;
	private ArrayList<String> mStrings = new ArrayList<String>();

	//Just a small Status Line in the Top
	TextView toptext;

	static int countlistentries;
	static Bitmap[] inipics;

	//ArrayList for Orb Responses (MediaTitle, Url ...)
	ArrayList<HashMap<String,String>> list = new ArrayList<HashMap<String,String>>();
	HashMap<String,String> item = new HashMap<String,String>(); 

	@Override
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		toptext = (TextView) findViewById(R.id.toptext);

		mAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, mStrings);

		setListAdapter(mAdapter);
		ListView MyOrbList = getListView();

		MyOrbList.setOnItemClickListener(new OnItemClickListener()
		{
			public void onItemClick(AdapterView<?> parent, View v,
					int position, long id)
			{
				String Mid =   list.get(position).get("id");

				//Get STREAM Information
				html = loaddata("http://api.orb.com/orb/xml/stream?sid="+sid+"&mediumId="+Mid+"&streamFormat=3gp&type=pda&width=480&height=360");

				int status = Integer.parseInt(GetXmlInnerNr("status", "code", html, 1));
				String uril = GetXmlInnerNr("item","url",html,1);

				Toast.makeText(Orband.this, "Status: "+status+" URL: "+uril,Toast.LENGTH_SHORT).show();

				if (status == 0)
				{
					Intent i = new Intent(Intent.ACTION_VIEW);
					Uri u = Uri.parse(uril);
					i.setData(u);
					startActivity(i);
				}

			}
		});

		do_main();

	}

	private void do_main()
	{

		Log.i(TAG, " *------ Login Orb -----*: ");
		html = loaddata("http://api.orb.com/orb/xml/session.login?apiKey="+apikey+"&l="+Username+"&password="+Password+"");

		int status = Integer.parseInt(GetXmlInnerNr("status", "code", html, 1));
		sid = GetXmlNr("orbSessionId", html, 1);
		toptext.setText("sid:" + sid + " status:" + status);

		if (status == 0)
		{

			Log.i(TAG, " *------ Load Media Data-----*: ");
			html = loaddata("http://api.orb.com/orb/xml/media.search?sid="+ sid + "&q=mediaType%3Dvideo&groupBy=author");

			// for AUDIO just change the Line above with this
			// html = loaddata("http://api.orb.com/orb/xml/media.search?sid="+ sid + "&q=mediaType%3Daudio&groupBy=author");

			status = Integer.parseInt(GetXmlInnerNr("status", "code", html, 1));
			Log.i(TAG, " *------ Media Result Status: " + status);

			if (status != 0)
			{
				toptext.setText("Status Error (2) : " + status);
			} else
			{
				int results = Integer.parseInt(GetXmlInnerNr("searchResult","itemCount", html, 1));
				//String ausgabe = "" + results + " Ergebnisse\n";
				Log.i(TAG, " *------ Media Result add 1: ");
				for (int i = 0; i < results; i++)
				{
					dummystr=GetXmlNr("field name=\"title\"", html, i);
					mAdapter.add(dummystr);
					item = new HashMap<String,String>();
					item.clear();
					item.put("title",dummystr);
					item.put("id",GetXmlInnerNr("item","orbMediumId", html, i));
					list.add(item);
				}
				Log.i(TAG, " *------ Media Result add 2: ");
			}
		} else
		{
			toptext.setText("Status Error (1) : " + status);
		}
	}

	private String loaddata(String Urli)
	{
		try
		{

			String mediaUrl = Urli;
			URLConnection conn;
			conn = new URL(mediaUrl).openConnection();

			InputStream is = conn.getInputStream();
			BufferedInputStream bis = new BufferedInputStream(is);
			ByteArrayBuffer baf = new ByteArrayBuffer(50);

			// loading part
			int current = 0;
			while ((current = bis.read()) != -1)
			{
				baf.append((byte) current);
			}
			// Log.i(TAG, " *------ Load Data done -----*: ");
			html = EncodingUtils.getString(baf.toByteArray(), "UTF-8");
			// ------
		} catch (Exception e)
		{
			Toast.makeText(this, "Shit, Loading Error!", Toast.LENGTH_SHORT).show();
		}

		return html;
	}

	public String GetXmlNr(String xtag, String xhtml, int pos)
	{
		// Log.i(TAG, " *xhtml: " + xhtml);
		String x1tag = "";
		String x2tag = "";
		String retstr = "";
		int xstart = 0;
		int dummy = 0;
		int xend = 0;
		int xcont = 0;
		int xcounter = 0;

		x1tag = "<" + xtag;
		dummy = xtag.indexOf(" ");
		if (dummy != -1)
			xtag = xtag.substring(0, dummy);
		x2tag = "</" + xtag + ">";

		do
		{
			xcounter++;
			xhtml = xhtml.substring(xcont);
			xstart = xhtml.indexOf(x1tag);
			// Log.i(TAG, " *xstart1: " + xstart);
			xstart = xhtml.indexOf(">", xstart);
			if (xstart < 0)
				return "";
			xend = xhtml.indexOf(x2tag, xstart);
			if (xend < 0)
				return "";

			retstr = xhtml.substring(xstart + 1, xend);

			xcont = xend + x2tag.length();

		} while (xcounter < pos);

		return retstr;
	}

	public String GetXmlInnerNr(String xtag, String Attrib, String xhtml,
			int pos)
	{

		String x1tag;
		int x1len;
		String x2tag;
		String retstr;
		int xstart;
		int xend;
		int xcont = 0;
		int xcounter = 0;

		do
		{
			xcounter++;
			xhtml = xhtml.substring(xcont);
			// Log.i(TAG, "* xhtml: " + xhtml);
			x1tag = "<" + xtag;
			x1len = x1tag.length();
			x2tag = ">";

			xstart = xhtml.indexOf(x1tag);
			if (xstart < 0)
				return "";

			xend = xhtml.indexOf(x2tag, xstart);
			if (xend < 0)
				return "";

			// Log.i(TAG, "* xstart: " + xstart + " xend: " + xend);

			String Innerhtml = xhtml.substring(xstart + x1len, xend);

			// now search in the innerarea
			x1tag = Attrib + "=\"";
			x2tag = "\"";
			x1len = x1tag.length();
			xstart = Innerhtml.indexOf(x1tag);

			if (xstart < 0)
				return "";

			xcont = xend + 1;

			xend = Innerhtml.indexOf(x2tag, xstart + x1len);
			if (xend < 0)
				return "";
			retstr = Innerhtml.substring(xstart + x1len, xend);
			;

		} while (xcounter < pos);

		return retstr;
	}

}

— and here the Main.XML


<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

android:orientation="vertical"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

>

<TextView

android:id="@+id/toptext"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="@string/hello"

/>

<ListView android:id="@android:id/list"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:transcriptMode="normal"/>

</LinearLayout>
<div>

—AndroidManifext.XML


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.development.orband"
android:versionCode="1"
android:versionName="1.0.0">
<uses-permission android:name="android.permission.INTERNET" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Orband"
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>
Category: android  Tags: , , ,  3 Comments