Basic Questions Regarding the Graphic and showing FPS()

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Basic Questions Regarding the Graphic and showing FPS()

Postby home3d2001 » Sun Aug 09, 2009 5:25 am

Hi there,

this is my first post here and hope someone help me out. Before asking my question, I am still a beginner to android SDK so please bear with me if my questions seem stupid.I have also attached my android project so you can see what I am doing.

I mainly have four questions:


1- In my main activity I have 4 buttons and a background.I made the background in Xml using ImageView. Could you please tell me how I can use java code instead of xml for showing my background considering the way my code is?.

2- what if I want to have an animation behind my buttons? How can I do that?

3-I want to have an image which fades/out before the main activity shows up.How can I achieve it?

4-I want to show a fps(frame per second) during the whole game in all my activities.How can I do that?.If you look at my code there a textview which has a value of 0 .if you look at Hsudoku_view.java you can see I have a function called showfps(). but I don't know how to show it in my view regarding the code I have.


Sorry, I know it is a lot of questions but this forum is my hope. Thank you so much in advanced for any helps or suggestions.
Attachments
HSudoku.rar
(1.15 MiB) Downloaded 40 times
home3d2001
Freshman
Freshman
 
Posts: 3
Joined: Sun Aug 09, 2009 4:39 am

Top

Re: Basic Questions Regarding the Graphic and showing FPS()

Postby mad.dogg » Mon Aug 10, 2009 3:53 pm

1- Load the image View.setBackgroundDrawable(Drawable).

2- Create a custom view, and draw on it. Or you may animate the view depending on your needs. Refer to the docs.

3-So I am assuming that you've created the "splash" activity and it has an image. Just call setOutAnimation(...) on the view that is holding the image.

4-I don't think I understand the question, what you have and where is the problem?
If it's boring it ain't heavy enough!
mad.dogg
Developer
Developer
 
Posts: 42
Joined: Tue May 20, 2008 2:18 pm
Location: Bulgaria

Postby home3d2001 » Tue Aug 11, 2009 4:25 am

Thank you so much mag.dogg,


Q3: Yes I have setup the splash screen and it works fine but still can't figure out how to apply setOutAnimation(...)? . Could u please provide it with more codes.I appreciate it.


Here is what I have in my Splashview.java:


Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. package com.example.HSudoku;
  3.  
  4.  
  5.  
  6. import android.content.Context;
  7.  
  8. import android.view.View;
  9.  
  10.  
  11.  
  12. public class Splashview extends View {
  13.  
  14.    
  15.  
  16.        
  17.  
  18.         public Splashview (Context context) {
  19.  
  20.                 super(context);
  21.  
  22.                
  23.  
  24.                
  25.  
  26.         }
  27.  
  28.  
  29.  
  30. }
  31.  
  32.  
  33.  
  34.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
home3d2001
Freshman
Freshman
 
Posts: 3
Joined: Sun Aug 09, 2009 4:39 am

Postby mad.dogg » Tue Aug 11, 2009 11:59 am

Ok I must apologize for the out animation thing. It is actually a completely different thing. The setOutAnimation(...) is a method of ViewAnimator used by a couple of widgets like the ViewSwitcher for example.
Sorry about that.

Anyway lets go back to the point. Each View has a setAnimation(Animation) and startAnimation(Animation) methods.
Take a look here
and here for examples of how to define, load and use animations.

If you still have problems with that stuff post me a PM and we'll work them out.

Edit: You also might wanna have a look at LayoutAnimationController
If it's boring it ain't heavy enough!
mad.dogg
Developer
Developer
 
Posts: 42
Joined: Tue May 20, 2008 2:18 pm
Location: Bulgaria

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 8 guests