The Android virtual device (a simulated Android environment) doesn't run very smoothly on my machine. Scrolling and animations in general are quite sluggish. Is that normal?
I'm looking at the possibility of using Android as a secure corporate mobile platform.
One of the pre-requisites for this will be a way of managing multiple devices, security policies, software deployment, that sort of thing - essentially the things the BlackBerry Enterprise Server handles for BlackBerry or MDM (or something 3rd party like SOTI) handles for Windows Mobile.
Does such a thing exist for Android? It's a platform we're interested in but without this right now (and we're not in a position to build it ourselves) it's a non-starter.
I would like to show a banner in an Android activity.
The banner should be:
Aligned at the bottom of the layout
Take all the width and have relative height (say 100dip)
Be dismissable
When dismissed the rest of the layout should strech to fill the area that was occupied by the banner.
What's the best way to implement this in Android?
Thanks!
Forget screenshots, is it posible to capture a video of the running application in android?
Rooted or non-rooted, I don't care, I want atleast 15fps.
Update: I don't want any external hardware. The intent is to make it perfectly portable and every frame is captured within Android OS. If it crosses the boundaries of the app sdk, I'm willing to go to OS level modifications but I would need a starting point.
(I'm coming from an iPhone dev world. )
In Android do we need to worry what OS version we compile against? In the iPhone world I would usually target a release that's at least 6 months old to limit the number of issues with installing on iPhones with old OSs.
What strategy should I use when choosing what to compile against on the Android?
I will be releasing two applications soon, one for my company and one for me. Publishing app on my own is straightforward, but I'm not sure which account to use for the company.
What practice do you use in your company?
I only see one solution, creating a special google account like [email protected] shared by the company Android devs.
I have to read *.ics file from the download files by using my application and transfer the data in to Google calendar in android. I am new to android. I need some help to do this.Can anyone help me to do this?
I've reviewed all the similar questions here, but I can't for the life of me figure out what I'm doing wrong.
I've written an application that tries to launch various files, sort of a file browser, when a file is clicked it tries to launch the program based on it's associated MIME type or I want it to present the "Choose Application to Launch" dialog.
Here's the code I'm using to launch:
File file = new File(app.mediaPath() + "/" +_mediaFiles.get(position));
Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW);
String extension = android.webkit.MimeTypeMap.getFileExtensionFromUrl(Uri.fromFile(file).toString());
String mimetype = android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
myIntent.setDataAndType(Uri.fromFile(file),mimetype);
startActivity(myIntent);
This fails and generates a:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=file:///file:/mnt/sdcard/roms/nes/Baseball_simulator.nes }
Now if I install OI File Manager for instance, it opens instead of this error being thrown, and then if I click the same file from within in it, it launches the approriate dialogs.
I have noticed that the MIME type for that particular file fails, but other mime types like .zip do return values.
Am I missing something that when the MIME type is null to call a dialog that lets the user select?
I've tried other variations of launching the app, including not setting the mime type and only using .setData with no success.
The action I want to happen is, a user clicks a file, if it's associated with an application that app launches, if not, the user gets the "Complete action using" dialog with a list of apps.
Thanks for any advice.
From your experience, to develop an Android software for the marketplace, do i need a real Android device to test my applications or emulator is enough?
I'm planning on doing a application for Android 2.1 that changes song every minute (through what I hope exists in Android, "next") for the application using the audio device atm.
So if I have Spotify running in background already, playing music, can I through my program change to the next track?
Let me know if I was unclear about anything.
Thanks in advance!
I know that the android plattform is open source. What I am interested in is the share of open source Android apps, thus developers that realease their own apps under a open source license.
Does anybody have an idea, how to get this information?
I have a MySql database that stores a timestamp for each record I insert. I pull that timestamp into my Android application as a string. My database is located on a server that has a TimeZone of CST. I want to convert that CST timestamp to the Android device's local time.
Can someone help with this?
Hi i have erorr "R cannot be resolved" everytime when i create android project in eclipse under ubuntu with android sdk. In windows everything ok. What's wrong?
Why my java app for android not connect to server ?
I run the aplication in androidemulator, and the server wich port 9999 and host 127.0.0.1 in my pc, but just not connect and i think this method isn't good for android app.
It is my source code:
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
//Java imports
//import android.util.Log;
import java.io.*;
import java.net.*;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
public class MainActivity extends Activity
{
//Variaveis Interface
private Button ligar;
private Button enviar;
private EditText text1;
private TextView text2;
//Variaveis
static Socket cSocket;
static PrintWriter out;
static BufferedReader in;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//Declaração butões
ligar = (Button) findViewById(R.id.ligar);
enviar = (Button) findViewById(R.id.enviar);
text1 = (EditText) findViewById(R.id.text1);
text2 = (TextView) findViewById(R.id.text2);
//Interacao
ligar.setOnClickListener(new OnClickListener(){
public void onClick(View arg0){
connect();
}
});
enviar.setOnClickListener(new OnClickListener(){
public void onClick(View arg0){
out.println("Hello");
text2.setText("");
}
});
}
//Outras Funcoes
public void connect(){
//Funcao ligar
cSocket = null;
out = null;
in = null;
try
{
cSocket = new Socket("127.0.0.1",9999);
out = new PrintWriter(cSocket.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(cSocket.getInputStream()));
text2.setText("Estas conectado com sucesso.");
}
catch (IOException ex) {
//Logger.getLogger(client.class.getName()).log(Level.SEVERE, null, ex);
text2.setText("Erro! Na conexão");
}
}
//
}
I have some C++ code that I want to make into a static lib for use with Java on the Android platform. Can anyone point me to a resource that tells me how to do this? I am completely new to Java and Android.
I'm following this tutorial: http://huuah.com/android-progress-bar-and-thread-updating/
to learn how to make progress bars. I'm trying to show the progress bar on top of my activity and have it update the activity's table view in the background.
So I created an async task for the dialog that takes a callback:
package com.lib.bookworm;
import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;
public class UIThreadProgress extends AsyncTask<Void, Void, Void> {
private UIThreadCallback callback = null;
private ProgressDialog dialog = null;
private int maxValue = 100, incAmount = 1;
private Context context = null;
public UIThreadProgress(Context context, UIThreadCallback callback) {
this.context = context;
this.callback = callback;
}
@Override
protected Void doInBackground(Void... args) {
while(this.callback.condition()) {
this.callback.run();
this.publishProgress();
}
return null;
}
@Override protected void onProgressUpdate(Void... values) {
super.onProgressUpdate(values);
dialog.incrementProgressBy(incAmount);
};
@Override
protected void onPreExecute() {
super.onPreExecute();
dialog = new ProgressDialog(context);
dialog.setCancelable(true);
dialog.setMessage("Loading...");
dialog.setProgress(0);
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dialog.setMax(maxValue);
dialog.show();
}
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
if (this.dialog.isShowing()) {
this.dialog.dismiss();
}
this.callback.onThreadFinish();
}
}
And in my activity, I do:
final String page = htmlPage.substring(start, end).trim();
//Create new instance of the AsyncTask..
new UIThreadProgress(this, new UIThreadCallback() {
@Override
public void run() {
row_id = makeTableRow(row_id, layout, params, matcher); //ADD a row to the table layout.
}
@Override
public void onThreadFinish() {
System.out.println("FINISHED!!");
}
@Override
public boolean condition() {
return matcher.find();
}
}).execute();
So the above creates an async task to run to update a table layout activity while showing the progress bar that displays how much work has been done..
However, I get an error saying that only the thread that started the activity can update its views. I tried doing:
MainActivity.this.runOnUiThread(new Runnable() {
@Override public void run() {
row_id = makeTableRow(row_id, layout, params, matcher); //ADD a row to the table layout.
}
}
But this gives me synchronization errors.. Any ideas how I can display progress and at the same time update my table in the background?
Currently my UI looks like:
I am able to create, write and read an SQLite Database in my Android App. I have a copy of the Database that is fully populated with data, and I want to get that data into the App's Database. Is it possible to access my pouplaed database from inside my App? Or can I at least create a copy of the populated database and then use that copy? Or do I need to do a .dump and put all the inserts into the Android code?
I'm still new to Android, so, I'm still not so familiar with its libraries and APIs.
My first major project is a download manager which supports segmented downloading. I could already download files, but, I still have no idea on how or where to start for segmented downloading.
I have already browsed a lot of threads, but I really couldn't find any article or thread about segmented downloading in Android.
Can anyone please help me?
My company has many clients wanting mobile applications and having the payments come into our account and then sorting the payments would be a real pain.
So can a company have a main account to publish applications (free and chargeable) and still have some sort of client account for each app (so they could view sales and receive full payment directly)?
I would like to know for Windows, Android and Apple please.
I'm trying to get the resultCode to be OK inside my onActivityResult function. However, it keeps coming back as 0. I have spent several days on this, and can't figure out why it doesn't work. Here's my code. If anybody can help me, I'll be very grateful, Thanks.
My Activity1 class:
private class MyTask extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... urls) {
// process
return result;
}
@Override
protected void onPostExecute(String result) {
Intent i = new Intent(Activity1.this, Activity2.class);
i.putExtra("Value1", "This value one for ActivityOne ");
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivityForResult(i, REQUEST_CODE);
textView.setText(result);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK && requestCode == REQUEST_CODE) {
// do something
}
}
My Activity 2 class:
@Override
public void finish() {
Intent data = new Intent();
data.putExtra("returnKey1", "return 1");
setResult(RESULT_OK, data);
super.finish();
}
My manifest:
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Activity1"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Activity2"
android:label="@string/app_dialog_name"
android:launchMode="singleTop"
android:excludeFromRecents="true"
android:taskAffinity=""
android:theme="@android:style/Theme.Dialog">
</activity>
</application>
I am setting up a development environment for the latest Android 2.3 on a fresh install of Windows 7 64-bit.
I first installed the 64-bit JDK 6 (jdk-6u23-windows-x64.exe).
Then, I installed 64-bit Eclipse Classic 3.6 (eclipse-SDK-3.6.1-win32-x86_64.zip).
Then, I proceed to install the Android SDK Starter Package: installer_r08-windows.exe.
But... upon start it says: "Java SE Development Kit (JDK) not found."
Why? I just installed it.
Is this a mismatch between 32-bit and 64-bit?
How do I solve this?
Update (1): I tried setting the %JAVA_HOME% environment variable, as well as setting the Installed JREs in Eclipse, as suggested below. None of these solved the problem.
It appears that I am not the only experiencing the problem, as this thread suggests:
http://stackoverflow.com/questions/1919340/android-sdk-setup-under-windows-7-pro-64-bit
I wonder whether there is a 64-bit version of the Android SDK.
Update (2): I used the zip version instead (android-sdk_r08-windows.zip), ran android.bat, updated all SDK packages, and installed the ADT plugin (8.0.1), not before having to check: 'Contact all update sites during install to find required software'.
We'll see how this goes...
Update (3): It worked! (going to accept @bubu's answer shortly) -- but why doesn't the emulator include the HelloAndroid app when I run it (Ctrl+F11) from Eclipse?
I am setting up a development environment for the latest Android 2.3 on a fresh install of Windows 7 64-bit.
I first installed the 64-bit JDK 6 (jdk-6u23-windows-x64.exe).
Then, I installed 64-bit Eclipse Classic 3.6 (eclipse-SDK-3.6.1-win32-x86_64.zip).
Then, I proceed to install the Android SDK Starter Package: installer_r08-windows.exe.
But... upon start it says: "Java SE Development Kit (JDK) not found."
Why? I just installed it.
Is this a mismatch between 32-bit and 64-bit?
How do I solve this?
Update (1): I tried setting the %JAVA_HOME% environment variable, as well as setting the Installed JREs in Eclipse, as suggested below. None of these solved the problem.
It appears that I am not the only experiencing the problem, as this thread suggests:
http://stackoverflow.com/questions/1919340/android-sdk-setup-under-windows-7-pro-64-bit
I wonder whether there is a 64-bit version of the Android SDK.
Update (2): I used the zip version instead (android-sdk_r08-windows.zip), ran android.bat, updated all SDK packages, and installed the ADT plugin (8.0.1), not before having to check: 'Contact all update sites during install to find required software'.
We'll see how this goes...
Update (3): It worked! (going to accept @bubu's answer shortly) -- but why doesn't the emulator include the HelloAndroid app when I run it (Ctrl+F11) from Eclipse?
I'm trying to create android apps which able sending data through wifi connection to my laptop Apache Server and MySQL database. I use the samsung galaxy tab 10.1 as my mobile device. and the protocol i used is HttpGet or HttpPost. And i use XAMPP( with Apache& SQL) to do the server and process the php. But, due to android cannot detect adhoc network from laptop, i use Virtual Router ( for window 7) to create virtual access point and make the tablet able connect to my laptop. But the problem is:
[1] in my apps (client-android), where the httpget or httppost to which url? localhost in my laptop- 127.0.0.1 or localhost in android 10.0.0.1? or the ip address of the virtual router?
[2]so, if i want access from android to the localhost(laptop-Apache) to call the php to run?
which port? which ip address /url that i need to put in android apps(httpget)? and do i need to modify anything in httpconfig for XAMPP?
thanks alot.