Problem

by Alowishus » Wed, 04 Feb 2009 23:50:22 GMT


Sponsored Links
 Okay Gang,

Here is the problem, I am building an application and have multiple
images that need to switch when the user touches the screen, doesn't
matter where the users touches. The press the screen and the images
switch randomly. I purchased the ebook "Professional Android
Application Development" and have torn though it. I am stumped. I'm
thoroughly confused at this point. Any ideas on where I can go or how
I can accomplish this?

The simpler the terms you can put it in the better.

Thanks in advance,

Kevin
--~--~---------~--~----~------------~-------~--~----~



Problem

by Phill Midwinter » Thu, 05 Feb 2009 00:11:09 GMT


 Read your book more slowly.

2009/2/4 Alowishus <alowis...@gmail.com>



-- 
Phill Midwinter
Director
Grant Midwinter Limited
d: 0844 736 5234 x: 0
m: 07538 082156
e: ph...@grantmidwinter.com

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Problem

by Faber Fedor » Thu, 05 Feb 2009 00:13:06 GMT


 Start here: 
 http://www.catb.org/ ~esr/faqs/smart-questions.html< http://www.catb.org/ %7Eesr/faqs/smart-questions.html>






-- 

Faber Fedor
Cloud Computing New Jersey
 http://cloudcomputingnj.com 

--~--~---------~--~----~------------~-------~--~----~



Problem

by Alowishus » Thu, 05 Feb 2009 00:56:01 GMT


 Wow, thanks for all the constructive advice guys. I really appreciate
that.
--~--~---------~--~----~------------~-------~--~----~



Problem

by Mark Murphy » Thu, 05 Feb 2009 01:08:45 GMT


 


I'm not quite sure why you got the reaction you did. On the other hand,
I haven't played with low-level touch events, so I personally don't have
any specific advice to offer.

The SDK samples, like the ApiDemos, are a treasure trove for stuff like
this. If you can find a demo that does what you want, look at the source
code in your SDK's samples/ directory.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
Android Training in Sweden --  http://www.sotrium.com/training.php 

--~--~---------~--~----~------------~-------~--~----~



Problem

by Peli » Thu, 05 Feb 2009 01:38:19 GMT


 The constructive advice is justified. We all would like to help you,
but we don't know what your problem is:

Is your problem:
1) You don't know how to catch a touch event on the whole screen?
2) You don't know how to switch images?
3) You don't know how to display an image?
4) You don't know how to write an Android application?
5) You don't know anything about (Java) programming and just started?

Depending on what your true question is, the answer that may help you
may be quite different.

Peli
www.openintents.org



--~--~---------~--~----~------------~-------~--~----~



Problem

by Alowishus » Thu, 05 Feb 2009 02:04:32 GMT


 @ Mark, Thanks.

@Peli,

1) You don't know how to catch a touch event on the whole screen?
    Correct, I don't know how to catch a touch event

2) You don't know how to switch images?
    Correct, I cannot figure this out

3) You don't know how to display an image?
    I know how to display an image

4) You don't know how to write an Android application?
    Im good with this one too

5) You don't know anything about (Java) programming and just started?
    Been a few years, I'm a little rusty but catchy on quick again
--~--~---------~--~----~------------~-------~--~----~



Problem

by Peli » Thu, 05 Feb 2009 02:13:42 GMT


 >   Correct, I don't know how to catch a touch event
Have a look at setOnClickListener:
 http://code.google.com/android/reference/android/view/View.html #setOnClickListener(android.view.View.OnClickListener%29

or at onTouchEvent:

 http://code.google.com/android/reference/android/view/View.html #onTouchEvent(android.view.MotionEvent%29

There's in image switcher:
 http://code.google.com/android/reference/android/widget/ImageSwitcher.html 

For both you will find sample code in the API demos.

Peli
www.openintents.org



--~--~---------~--~----~------------~-------~--~----~



Problem

by Peli » Thu, 05 Feb 2009 02:19:43 GMT


 A quick search on anddev.org brings up some relevant sample code:
 http://www.anddev.org/loop_to_display_imageview-t4370.html 

Peli
www.openintents.org



--~--~---------~--~----~------------~-------~--~----~



Problem

by jsymone...@prosoftco.com » Thu, 05 Feb 2009 02:31:53 GMT


 Your kidding me?  A developer asks a questions and you two are rude to
him?  If you don't have something to say to answer the question, why
bother even responding?  No one needs to hear your snide remarks
especially when someone is trying to learn and grow in this area.





--~--~---------~--~----~------------~-------~--~----~



Problem

by Marco Schmitz » Fri, 06 Feb 2009 18:30:24 GMT


 hi,

maybe you start with the onTouchEvent which each Activity has:

public boolean onTouchEvent(MotionEvent event) {...}

then you can get the Id of each button.

changing the way the button looks can be manipulated using
button.setBackground().

there you can add a resource (like a .png or a .9.png)

hope this helps you a little

greetings
darolla

ps: I am sorry that you got those stupid answers yet...



2009/2/4 jsymone...@prosoftco.com <jsymone...@prosoftco.com>:



--~--~---------~--~----~------------~-------~--~----~



Problem

by prateek tuli » Sun, 01 Aug 2010 13:04:54 GMT


 Hi,
I want to create an application in android which at runtime calls an
xml file from some path of the system.And make that contents of the
xml file run in the same application.Could i get a feasible code
because at runtime the bytecode of the activity is already created.how
do i compile and run the activity and runtime.Also i was facing
problem reading the xml file.Need some suggestions asap..
Thanx in advance!!

--



Problem

by { Devdroid } » Sun, 01 Aug 2010 20:26:52 GMT


 


XML files are not executables so they cannot be run. Please be more
specific on what your are really want to achieve as it's hard to advice
on "some <unnamed> problems"

--



Problem

by Ed » Mon, 02 Aug 2010 12:10:42 GMT


 It sounds like you're trying to dynamically inflate an xml layout and
run dynamic code.

XML Layout:
 Android doesn't support the use of dynamic xml layouts:
    he view hierarchy inflation (and many other things that use XML
resources) relies on
     the preprocessing performed by the resource compiler when
building the application.
     They can not be used with plain XML files.

     It would certainly be nice to be able to inflate from raw XML
files, but there is no
     plan to do this any time soon due to the effort involved and that
it is questionable
     whether the performance would be acceptable.
Code:
  Android is using compiled java. As it is not an interpreted language
you will not be able to use approaches available in other languages
e.g. Javascript's exec()

I've spent a fair bit of time looking at this problem myself and
basically the most viable solution is to come up with your own
simplified subset of layout commands and use these to dynamically add
views to a placeholder. As for the running of code again you need to
come up with a simplified set of changes you might want to make on the
fly e.g. what method to call onClick for button X.

I have considered writing a generic reusable solution to this very
problem but I think the subset of language components for both views
and code would be hard to define for unknown applications.

Ed






--



problem

by med hicham » Sat, 12 Feb 2011 06:07:35 GMT


  started an android application with Eclipse but i have the following
problem:
org.eclipse.core.runtime.CoreException: Error opening the Android XML
editor. Is the document an XML file?
at
com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor.createTextEditor(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor.createAndroidPages(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor.addPages(Unknown
Source)
at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:
146)
at
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:
310)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:
661)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:
428)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:
594)
at
org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(EditorAreaHelper.java:
263)
at
org.eclipse.ui.internal.EditorManager.setVisibleEditor(EditorManager.java:
1410)
at org.eclipse.ui.internal.EditorManager
$5.runWithException(EditorManager.java:944)
at org.eclipse.ui.internal.StartupThreading
$StartupRunnable.run(StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:
133)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:
3800)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3425)
at
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:
803)
at org.eclipse.ui.internal.Workbench
$27.runWithException(Workbench.java:1363)
at org.eclipse.ui.internal.StartupThreading
$StartupRunnable.run(StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:
133)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:
3800)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3425)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2295)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:
288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:
490)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:
149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:
113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:
193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:
110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:
79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:
386)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:
179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)



Other Threads

1. about Android camera log

Dear all ~~

I have implemented the camera hal with v4l2 , but it doesn't work well
now . I have printed the log , who can tell me where is the source of
the log below :

E/camera  ( 2084): preview hasn't started yet in 1 seconds
E/camera  ( 2084): preview hasn't started yet in 2 seconds

I readed the camera.cpp and Icamera.cpp ,and didn't found these
logs .Does the camera client preview will exit if the preview hasn't
started in 2 seconds ~~?


--~--~---------~--~----~------------~-------~--~----~

2. HTC G1 vs G2

So Google gave away hundreds of the newer HTC G2. Will there be a 
developer version available soon, as the G1 is now?

Is the G2 preferable for someone just starting with Android development?

Thanks

Bruce

------- WWW.SYSTRONIX.COM ----------
   Real embedded Java and much more
+1-801-534-1017  Salt Lake City, USA 


--~--~---------~--~----~------------~-------~--~----~

3. Is there any official way to upgrade Android OS?

4. Can I lock the scrolling of ListView ?

5. device not detected in eclipse

6. aac header info in PVAuthor

7. How to detect Android phone or emulator is at Idle screen?