[android-developers] Developing custom component for android, example - CustomSpinner

2010-11-18 Thread Vitaliy Tarasenko
Android CustomSpinner Component
I've created a custom component which works like a lock of a safe.

Component is an extention of ScrollView. It have ability to scroll
inner views, but one an inner view always will be centered. After
scrolling, the component will do own smooth scrolling to set spinner
in a correct position.
So if you use it, you can set some own views, set different
backgrounds for any view, and for header and footer of CustomSpinner.

Source you can find here:
http://code.google.com/p/customspinner/

If someone have question how to create own components or how works
mine component please answer,
but be sure that you have read this:
http://developer.android.com/guide/topics/ui/custom-components.html

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Accessing style items by style ID

2010-11-16 Thread Vitaliy Tarasenko
I found a solution. defStyle parameter is not needed for it. All I
need exists in attrs parameter.
TypedArray attrsArray = context.obtainStyledAttributes(attrs,
R.styleable.MyComponent);
bg = attrsArray.getResourceId(R.styleable.MyComponent_attribute,
defaultId);

On 15 ноя, 22:38, Vitaliy Tarasenko  wrote:
> Hello. I have a problem.
> Any View have a constructor
> public View (Context context, AttributeSet attrs, int defStyle) which
> called when View declared with a style attribute
> So, if I have some class inherited from View class, I can access to
> declared attributes (like "android:layout_width" or
> "android:background") via AttributeSet attrs in a constructor. But
> when I move attributes to style I cannot see attributes and values
> exists in a style - I want to read items declared in style but I have
> only styleID in defStyle parameter. Is there some way to read style
> Items using styleID?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Accessing style items by style ID

2010-11-15 Thread Vitaliy Tarasenko
Hello. I have a problem.
Any View have a constructor
public View (Context context, AttributeSet attrs, int defStyle) which
called when View declared with a style attribute
So, if I have some class inherited from View class, I can access to
declared attributes (like "android:layout_width" or
"android:background") via AttributeSet attrs in a constructor. But
when I move attributes to style I cannot see attributes and values
exists in a style - I want to read items declared in style but I have
only styleID in defStyle parameter. Is there some way to read style
Items using styleID?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: How to update my database with an xml hosted on a website?

2010-11-04 Thread Vitaliy Tarasenko
public void updateDatabase(){
XmlPullParser parser = Xml.newPullParser();
try{
InputStream stream = getInputStream();
parser.setInput(stream, null);
int eventType = parser.getEventType();
//parse xml
//write data to database

}catch(Exception e){
Log.e("omg",""+e.getMessage());
}
}

private InputStream getInputStream() {
try {
final String xmlDataUrl="http://path/data.xml";;
URL feedUrl = new URL(xmlDataUrl);
return feedUrl.openConnection().getInputStream();
} catch (Exception e) {
Log.d("omg",""+e.getMessage());
throw new RuntimeException(e);
}
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: i am new in Android and i don't know how to create media player project please help me

2010-10-14 Thread Vitaliy Tarasenko
What do you mean cant create? Object of MediaPlayer class?? Project
for using media player is similiar for any android project -
MediaPlayer is usual class which you can use.

On 14 Жов, 21:27, ketan mehta  wrote:
> i am new in Android and i don't know how to create media player
> project please help me
> i read about streaming i see Android developer Example but i can't
> create media player  so please help me
>
> thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: runtime error on softkeyboard using LatinIME.git example

2010-10-13 Thread Vitaliy Tarasenko
Error is on parsing xml:
http://schemas.android.com/apk/res/android";
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="@dimen/candidate_strip_height"
android:background="@drawable/keyboard_suggest_strip"
>

















on the line http://groups.google.com/group/android-developers?hl=en


[android-developers] runtime error on softkeyboard using LatinIME.git example

2010-10-13 Thread Vitaliy Tarasenko
Hello!

I need help from someone of professional android developers. I develop
softkeyboard for android 2.2. I wanted to use LatinIME.git as example.

An Eclipse project is correct and can be compiled, but after
installing app and setting keyboard as input method on device(I use
HTC Desire on 2.2) I have a runtime error: 10-13 16:31:03.809: ERROR/
AndroidRuntime(4917): FATAL EXCEPTION: main 10-13 16:31:03.809: ERROR/
AndroidRuntime(4917): android.view.InflateException: Binary XML file
line #43: Error inflating class 10-13 16:31:03.809: ERROR/
AndroidRuntime(4917): at
android.view.LayoutInflater.createView(LayoutInflater.java:513) 10-13
16:31:03.809: ERROR/AndroidRuntime(4917): at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:
56) 10-13 16:31:03.809: ERROR/AndroidRuntime(4917): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
10-13 16:31:03.809: ERROR/AndroidRuntime(4917): at
android.view.LayoutInflater.rInflate(LayoutInflater.java:618) 10-13
16:31:03.809: ERROR/AndroidRuntime(4917): at
android.view.LayoutInflater.rInflate(LayoutInflater.java:621) 10-13
16:31:03.809: ERROR/AndroidRuntime(4917): at
android.view.LayoutInflater.inflate(LayoutInflater.java:407) 10-13
16:31:03.809: ERROR/AndroidRuntime(4917): at
android.view.LayoutInflater.inflate(LayoutInflater.java:320) 10-13
16:31:03.809: ERROR/AndroidRuntime(4917): at
android.view.LayoutInflater.inflate(LayoutInflater.java:276) 10-13
16:31:03.809: ERROR/AndroidRuntime(4917): at
com.android.inputmethod.latin.LatinIME.onCreateCandidatesView(LatinIME.java:
410) 10-13 16:31:03.809: ERROR/AndroidRuntime(4917): at
android.inputmethodservice.InputMethodService.showWindowInner(InputMethodService.java:
1317) 10-13 16:31:03.809: ERROR/AndroidRuntime(4917): at
android.inputmethodservice.InputMethodService.showWindow(InputMethodService.java:
1285) 10-13 16:31:03.809: ERROR/AndroidRuntime(4917): at
android.inputmethodservice.InputMethodService
$InputMethodImpl.showSoftInput(InputMethodService.java:388)

... After force closing keyboard works but KeyboardView is showing
something wrong (pls. see pictures: 
http://i.piccy.info/i5/84/38/593884/latin1.png
http://i.piccy.info/i5/85/38/593885/latin2.png).

Thanks a lot.

Best Regards, Vitaliy.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en