[android-developers] Bug with Animation on Android?

2014-06-20 Thread Rafa Firenze


this is quite difficult to explain, but here we go!

Ok, the transition until I get the Fragment where the Animation is placed 
would be:

MainActivity (extends Activity) - loginActivity (extendsActivity) - now I 
call:

Intent homeIntent = new Intent(loginActivity.this, HomeActivity.class);Bundle 
bundle = new Bundle();
bundle.putSerializable(risposta,(Serializable)risposta);
homeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // read below 
homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); // read below 
homeIntent.putExtras(bundle);
startActivity(homeIntent);

which starts *HomeActivity* which extends *FragmentActivity* and at the end 
of onCreateView() I add my Fragment *CircleFragment* that @Overrides this 
on onResume():

RotateAnimation rotateAnimation1 = new RotateAnimation(0, 360,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation1.setInterpolator(new LinearInterpolator());
rotateAnimation1.setDuration(4000);
rotateAnimation1.setRepeatCount(Animation.INFINITE);
radar.startAnimation(rotateAnimation1);

or XML (tried both):

?xml version=1.0 encoding=utf-8?rotate
  xmlns:android=http://schemas.android.com/apk/res/android;
  android:fromDegrees=0
  android:interpolator=@android:anim/linear_interpolator
  android:toDegrees=360
  android:pivotX=50%
  android:pivotY=25%
  android:duration=4000
  android:startOffset=0/

*WHAT HAPPENS?*

*SOMETIMES* it works bad (sometimes fine!): it starts arround ~(50%, 25%) 
(or 0.5, 0.25), not exactly (calculated) but if I let the screen go off and 
I resume it, everything works again :O

*WHY IS IT STRANGE?*

   1. do you see the two lines commented which cleans the task and start 
   the activity on top ? if I don't set that, everything is OK
   2. If I start it as MainActivity - HomeActivity and doing finish 
   (instead clearing tasks), it works as well fine.

What's happening?

Thanks in advance.

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] FragmentActivity and TabHost - I'm not understanding anything

2014-02-06 Thread Rafa Firenze
I've seen all the posts of TabHost + FragmentActivity on Google Groups and 
on StackOverflow and I'm still getting problems.

And I don't understand anything. 

I'm following this tutorial for TabHost and FragmentActivity: 
http://thepseudocoder.wordpress.com/2011/10/04/android-tabs-the-fragment-way/

I have the following thing:
in a tab I load a CategoriaFragment.class, where I load a ListView and I 
set a ListView.OnItemClickListener for it. When I click, I call this code:

CategoriaFragment fragmentnuevo = new CategoriaFragment();
FragmentTransaction transaction = 
getActivity().getSupportFragmentManager().beginTransaction();
Bundle b = new Bundle();
b.putBoolean(flagSottoCategorie, true);
b.putSerializable(sottocategorielista, 
(Serializable)sottocategorielista);
   fragmentnuevo.setArguments(b);
transaction.addToBackStack(null);
transaction.add(R.id.realtabcontent, fragmentnuevo, FragmentTAG); 
// FragmentTAG is the same tag that the current Fragment
transaction.commit();

and yes, I call the same type of Fragment because I need the same recurses 
but with another List (sottocategorielista). This is not the error because 
I've tried to use another .class and it's the same error.

When I press back button, I get again my first ListView but listeners are 
not available. So I click and nothing happens. I've used add and replace as 
well.

Moreover, when I try to change Tab, if add is typed, I get several 
fragments in the same layout, if remove is typed, I get only one fragment 
on onTabChanged, but when I get back to my Fragment, nothing is available. 
Moreover if I press back button, I get the `java.IllegalStateException` 
saying 

 Fragment is already added: CategoriaFragment

What should I do?
Everything is easier with TabActivity, which is deprecated now and I would 
like to do everything with Fragments.

This is how my onTabChanged works (also available on the resource on the 
web)

public void onTabChanged(String tag) {
TabInfo newTab = this.mapTabInfo.get(tag);
if (mLastTab != newTab) {
FragmentTransaction ft = 
this.getSupportFragmentManager().beginTransaction();
if (mLastTab != null) {
if (mLastTab.fragment != null) {
ft.detach(mLastTab.fragment);
}
}
if (newTab != null) {
if (newTab.fragment == null) {
newTab.fragment = Fragment.instantiate(this,
newTab.clss.getName(), newTab.args);
ft.add(R.id.realtabcontent, newTab.fragment, 
newTab.tag);
} else {
ft.attach(newTab.fragment);
}
}
 
mLastTab = newTab;
ft.commit();
this.getSupportFragmentManager().executePendingTransactions();
}
}

Thanks in advance.

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Loading a Listview from 5MB-JSON in server and start loading a map

2014-01-12 Thread Rafa Firenze
Hello, in my app I download a 5MB-JSON which populates a ListView of 
people. Then, if you click to the map, it shows the position of the people 
which also shows a infowindow with data.

I thought about loading the list, and at the same time loading the map with 
markers and able to get the infowindow but I've never done this... is this 
done with FRAGMENTS? Could you give me a link or youtube video to do this 
from API 8?

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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Live Wallpaper Battery Level

2011-11-28 Thread Rafa
Hello,
I leave the link in a new application that I posted on the Android
Market, is an Live Wallpaper Configurable for view your battery level.
(As you know, we're always outstanding in this issue).

http://market.android.com/details?id=com.rvb.app.fondo

If anyone wants to try, I appreciate your criticism and the
opportunities and tips for improvement.

Rafa.

-- 
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: Phone calls recording on 2.0

2011-03-17 Thread Rafa
appforce.org ogi.android at gmail.com writes:

 
 Thanks for your reply.
 


http://forum.xda-developers.com/showthread.php?t=863074
http://forum.xda-developers.com/showthread.php?t=994570


Let me know if you make advances please; i can record but annoying beep every 10
sec is heard by both parties.

-- 
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] USB Host

2009-12-17 Thread Rafa Perfeito
Hey droiders,

Im building an app that communicates with an external sensor, preferably by
USB. Now, as many of you already must know, Android smartphones and USB host
mode are not natural to one another... But im sure that one solution must be
available. At this point i see two possible alternatives:

   - Grant USB Host capabilities in the android device (dont know how or if
   is even possible, but im certain it involves hardware configuration somehow)
   and then port jUSB or JSR-80 or some other java based USB communication
   solution to android. In this case the switch host/slave must be dynamic in
   order to assure that the device can still connect to a host itself
   (computer)
   - Implement USB OTG (On-The-Go -
   http://en.wikipedia.org/wiki/USB_On-The-Go) on Android. This seems the
   most robust option but also kind of difficult... Anyone tried this?

By the way, my Android device is HTC magic. Any thoughts or ideas? They are
more than welcome.

Cheers

-- 
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] Action for receiving mail

2009-02-27 Thread Rafa

Hi every one, does any one knows which action could let a
broadcastreceiver react on an incoming email? For example, to be able
to react on a SMS is needed to add to the manifest.xml the following:

receiver android:name=.Receptor_SMS android:enabled=true
intent-filter
action 
android:name=android.provider.Telephony.SMS_RECEIVED /
/intent-filter
/receiver

Which action would be equivalent for receiving emails? Thanks in
advance.

Regards

--~--~-~--~~~---~--~~
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] Updating applications

2009-02-26 Thread Rafa

Hi to all. How can I update an application that is already installed
on an Android phone? I have read something of getting install
permissions and then refereeing to the fully qualified class-name for
the 'R'
class you're refereeing to but I am not clear of how to do this. I am
specially interested in being able to add new layouts to an installed
app. I hope some one can help me. Thanks in advance.

Regards
--~--~-~--~~~---~--~~
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] Single choice dialog item selection

2009-02-25 Thread Rafa

Hi every one. I have implemented a single choice dialog this way:

On my strings.xml I defined the following array and strings:

[syntax=xml]
string name=titulo_pedir_telIngresar número telefónico/string
string name=accion_selecionarAceptar/string
string name=accion_cancelarCancelar/string
!-- Opciones del menu de envio --
string-array name=select_dialog_items
itemEnviar vía SMS/item
itemEnviar vía email/item
/string-array
[/syntax]

and my single choice dialog is defined as it follows in my main.class

[syntax=java]
Builder builder = new AlertDialog.Builder(this);
builder.setIcon(R.drawable.alert_dialog_icon);
builder.setTitle(R.string.seleccionar_forma_envio);
builder.setSingleChoiceItems(R.array.select_dialog_items, 0, new
DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int whichButton)
{
/* User clicked on a radio button do some stuff */
}
});
builder.setPositiveButton(R.string.accion_selecionar, new
DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int whichButton)
{
/* User clicked Yes so do some stuff */
}
});
builder.setNegativeButton(R.string.accion_cancelar, new
DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int whichButton)
{
/* User clicked No so do some stuff */
}
});
builder.show();
[/syntax]

The idea of this is that the user of my app selects a item of the
array an base of the selection to realize some action. My problem is
that I don't know how to recognize which item of the array the user
selected. How can I solve my problem? Thanks in advance.

Regards
--~--~-~--~~~---~--~~
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: Single choice dialog item selection

2009-02-25 Thread Rafa

Thank you very much for your answer. I fixed the problem.

Regards

On 25 feb, 16:34, moazzamk moazz...@gmail.com wrote:
 You can try this :

 public AlertDialog.Builder   setOnItemSelectedListener
 (AdapterView.OnItemSelectedListener listener)

 Get the item when its selected, and based on the button clicked you
 can perform your action.

 http://developer.android.com/reference/android/app/AlertDialog.Builde...

 - Moazzamhttp://moazzam-khan.com/

 On Feb 25, 11:03 am, Rafa rbenavidesagu...@gmail.com wrote:





  Hi every one. I have implemented a single choice dialog this way:

  On my strings.xml I defined the following array and strings:

  [syntax=xml]
  string name=titulo_pedir_telIngresar número telefónico/string
  string name=accion_selecionarAceptar/string
  string name=accion_cancelarCancelar/string
  !-- Opciones del menu de envio --
  string-array name=select_dialog_items
  itemEnviar vía SMS/item
  itemEnviar vía email/item
  /string-array
  [/syntax]

  and my single choice dialog is defined as it follows in my main.class

  [syntax=java]
  Builder builder = new AlertDialog.Builder(this);
  builder.setIcon(R.drawable.alert_dialog_icon);
  builder.setTitle(R.string.seleccionar_forma_envio);
  builder.setSingleChoiceItems(R.array.select_dialog_items, 0, new
  DialogInterface.OnClickListener()
  {
  public void onClick(DialogInterface dialog, int whichButton)
  {
  /* User clicked on a radio button do some stuff */}
  });

  builder.setPositiveButton(R.string.accion_selecionar, new
  DialogInterface.OnClickListener()
  {
  public void onClick(DialogInterface dialog, int whichButton)
  {
  /* User clicked Yes so do some stuff */}
  });

  builder.setNegativeButton(R.string.accion_cancelar, new
  DialogInterface.OnClickListener()
  {
  public void onClick(DialogInterface dialog, int whichButton)
  {
  /* User clicked No so do some stuff */}
  });

  builder.show();
  [/syntax]

  The idea of this is that the user of my app selects a item of the
  array an base of the selection to realize some action. My problem is
  that I don't know how to recognize which item of the array the user
  selected. How can I solve my problem? Thanks in advance.

  Regards
--~--~-~--~~~---~--~~
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] Receive email sdk 1.1

2009-02-24 Thread Rafa

Hi, on the sdk 1.1 release notes says:

The Settings and Email applications are now included in the SDK and
available in the emulator.

Does any one knows if is possible and/or how to react to an incoming
email? With this sdk version I am able to receive notifications of new
emails using the mail application on the emulator (having an account
configured in this app). As the notification is the same type as an
SMS notification and because in the SmsMessage class has methods to
handdle email messages I believe this should be possible. Does any one
knows something about this?
--~--~-~--~~~---~--~~
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: Create graphic interfaces dinamically

2009-02-24 Thread Rafa

Wouter Lagerweij, thank you very much for your answer. I already had
consider the second alternative that you mentioned but I think that
there must be another way. Your first option was very interesting. I
didn't know that was possible to create updates for an android
application. Can you tell me how to refer to the fully qualified
classname for the 'R' class and which permissions did you used in you
application? Finally I got one more doubt. How did you manage to show
you update layouts, for example to save information that the user
writes on a text field of the app's layout? Thank you in advance.

Regards

On 23 feb, 16:50, Wouter Lagerweij woute...@gmail.com wrote:
 The LayoutInflator docs 
 (http://developer.android.com/reference/android/view/LayoutInflater.html) are
 very explicitly saying this is not possible.

 You could possibly do something by getting 'install' permissions for your
 app, and installing additional .apk files containing extra layouts. I've
 just tried, and instantiating a layout from an already installed .apk seems
 to work, as long as you refer to the fully qualified classname for the 'R'
 class you're refering to.

 Or you could parse the files yourself, of course, and built the UI in your
 own code. Not very nice, but doable if the layout elements used can be
 limited.

 Wouter

 On Mon, Feb 23, 2009 at 7:09 PM, Rafa rbenavidesagu...@gmail.com wrote:

  Hi every one, I trying to create an application similar to the
  notepad3 tutorial. The main difference is that I need to be able to
  create different note formats. Is possible to obtain an xml file
  from the web and use it in the creation of an android interface? I
  have researched about the Metawidget library that is a very useful
  tool for android but I haven't been able to create interfaces
  dynamically. Does any one knows how this can be done? Thanks in
  advance.

  Regards,
  Helios
--~--~-~--~~~---~--~~
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] Create graphic interfaces dinamically

2009-02-23 Thread Rafa

Hi every one, I trying to create an application similar to the
notepad3 tutorial. The main difference is that I need to be able to
create different note formats. Is possible to obtain an xml file
from the web and use it in the creation of an android interface? I
have researched about the Metawidget library that is a very useful
tool for android but I haven't been able to create interfaces
dynamically. Thanks in advance.

Regards,
Helios

--~--~-~--~~~---~--~~
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] Create graphic interfaces dinamically

2009-02-23 Thread Rafa

Hi every one, I trying to create an application similar to the
notepad3 tutorial. The main difference is that I need to be able to
create different note formats. Is possible to obtain an xml file
from the web and use it in the creation of an android interface? I
have researched about the Metawidget library that is a very useful
tool for android but I haven't been able to create interfaces
dynamically. Does anyone know how to do this? Thanks in advance.

Regards,
Helios

--~--~-~--~~~---~--~~
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] Create graphic interfaces dinamically

2009-02-23 Thread Rafa

Hi every one, I trying to create an application similar to the
notepad3 tutorial. The main difference is that I need to be able to
create different note formats. Is possible to obtain an xml file
from the web and use it in the creation of an android interface? I
have researched about the Metawidget library that is a very useful
tool for android but I haven't been able to create interfaces
dynamically. Does any one knows how this can be done? Thanks in
advance.

Regards,
Helios
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---