I am generating file names that contain a timestamp in the following format:
"base_name (yyyy-mm-dd hhmmss).ext"
This seems to cause a problem on Android. Here's my log:
/storage/sdcard0/anMoney/transfer/Net worth over time _ Forecast (2012-11-19 110550).pdf
E/Gmail (11802): java.io.FileNotFoundException: /storage/sdcard0/myapp/transfer/Net worth over time _ Forecast (2012-11-19 110550).pdf: open failed: ENOENT (No such file or directory)
E/Gmail (11802): at libcore.io.IoBridge.open(IoBridge.java:416)
E/Gmail (11802): at java.io.FileInputStream.<init>(FileInputStream.java:78)
E/Gmail (11802): at java.io.FileInputStream.<init>(FileInputStream.java:105)
E/Gmail (11802): at android.content.ContentResolver.openInputStream(ContentResolver.java:445)
E/Gmail (11802): at com.google.android.gm.provider.MailEngine.cacheAttachment(MailEngine.java:3054)
E/Gmail (11802): at com.google.android.gm.provider.MailEngine.sendOrSaveDraft(MailEngine.java:2746)
E/Gmail (11802): at com.google.android.gm.provider.MailProvider.sendOrSaveDraft(MailProvider.java:477)
E/Gmail (11802): at com.google.android.gm.provider.MailProvider.insert(MailProvider.java:534)
E/Gmail (11802): at android.content.ContentProvider$Transport.insert(ContentProvider.java:201)
E/Gmail (11802): at android.content.ContentResolver.insert(ContentResolver.java:864)
E/Gmail (11802): at com.google.android.gm.provider.Gmail$MessageModification.sendOrSaveNewMessage(Gmail.java:3576)
E/Gmail (11802): at com.google.android.gm.ComposeActivity$SendOrSaveTask$1.onInitializationComplete(ComposeActivity.java:1765)
E/Gmail (11802): at com.google.android.gm.provider.MailEngine$5.run(MailEngine.java:1006)
E/Gmail (11802): at android.os.Handler.handleCallback(Handler.java:615)
E/Gmail (11802): at android.os.Handler.dispatchMessage(Handler.java:92)
E/Gmail (11802): at android.os.Looper.loop(Looper.java:137)
E/Gmail (11802): at android.os.HandlerThread.run(HandlerThread.java:60)
E/Gmail (11802): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
Now, if I trim the file name to have only 16 characters within the parentheses, everything is working as expected. I am able to send the file as a GMail attachment.
The following file name is working fine:
/storage/sdcard0/myapp/transfer/Net worth over time _ Forecast (2012-11-19 11070).pdf
I tried the following troubleshooting:
It's not the overall length of the file name, as if I shorten the base name, the same behavior remains
It's not GMail, uploading the file to Google Drive fails similarly
16 characters inside the parentheses work, but not 17
It's not the space character inside the parentheses that causes the issue, as I replaced it with a dash and it's the same problem.
Anybody has any ideas on what's going on here?
(I am coming from an iPhone experience)
When we create an iPhone app, Apple gives us a http URL that we can put on web pages that when clicked will open iTunes and give the user a chance to buy on their desktop.
As Android has no "iTunes" Windows/Mac application on the desktop, what do I link to on my Web pages/email marketing so that users can go and buy the Android apps we are writing?
Ian
Hello Developers
Thanks to every on to supportandroid development forum.
I want to make a application where when I click a button in my application then open android
built-in Calculator application.
That means I want to call calculator apk file from my application.
Is it possible?
Advanced thanks to reply
Hi,
Tried posting this at android dev, wanted to go here too in case anyone knows. I'm trying to supply a custom background drawable for a dialog. I've created the following in my styles.xml file:
<style name="CustomDlg" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@drawable/my_background</item>
</style>
This works fine on 1.6+. On my g1 running 1.5 (and the 1.5 emulator) the drawable is used, but the area around the dialog is opaque black instead of being translucent.
Is there something I'm missing here, or is this a bug with 1.5? Any work arounds? Is 1.5 just the ie6 of Android?
Thanks
I've seen others discussing printing labels with a dedicated label printer using Java.
Is there any way to print labels using a regular printer with label paper using (optimally) Android libraries/API? If not, is there any way to do this in a non-mobile context using Java?
Searching for "Java Label Printing" is only turning up the aforementioned dedicated label printing bits, which aren't quite what I'm looking for.
Hi everyone! I wanna know if the developer team wich made the emulator have some information to make bluetooth works in the android emulator, indicate some links about it, if they have some date for release or if they'll make it works in the future.
Thanks.
Is it possible to download a folder and its contents using air for android? I would like to also use the same code on iPhone.
I need it to be stored in the application storage so we can reference the content once downloaded.
I know it's possible to download content as referenced in this question: Download Content using Air For Android
but can a person download the entire folder and again store it in the application directory?
Thanks
@lukevain? :)
Are there any requirements/guidelines for an Android device? like numbers of buttons or minimum buttons required.
Also are there any android devices which do not have the menu and back buttons?
( I am aware that no menu/back buttons will kill most of the apps in terms of usability , I just wanted to know more on the topic :-) )
I am starting Android development. Which of the many Eclipse downloads do I need from http://www.eclipse.org/downloads/ ?
I am only ever going to do Android dev with Eclipse ever.
Platform: MAC 64 bit Snowleopard
I'm doing some initial research on smart phone development, and I noticed that Android and Windows Mobile both support c++ for application development. I was curious if anyone had any experience trying to manage shared files between both Android and Windows Mobile, and to what extent that code can be shared? e.g. no user interface can be shared, but web service and business logic classes can be shared, etc.
Hi,
In android, is it recommend to use static variable?
E.g, implement a Singleton pattern in Java, I usually do:
private static A the_instance;
public static A getInstance() {
if (the_instance == null) {
the_instance = new A();
}
return the_instance;
}
My question is when do that get free by android JVM?
Thank you.
It is my first time building an android app. Was wondering firstly, if there are demos that exists which could help me to build a media tag editor (form to edit mp3 files).
I would also like to know how to populate the sd card on the emulator.
Any help on android would be good. Thanks all!
can someone explain to me the concept behind using bluetooth
my project in my studies is to make an android app using bluetooth, SQLLIGHT and google app
the app itself is a very easy one but i just dont get the tools i need to use :
how does the bluetooth works?
is there a simple example ?
the concept behind android GUI (i allready nade one but i think i am not fully understood his power)?
note : i am using v 2.1
Currently working on multiple projects that need to share internal libraries. The internal libraries are updated continually. Currently only 1 project needs to be stable but soon we will need to have both projects stable at any given time.
What is the best way to SVN internal libraries?
Currently we are using the 'just another folder' like so...
trunk\project1
trunk\project2
trunk\libs
It causes a major headache when a shared library is updated for project1 and project2 is now dead until the parts that use the library are updated.
So after doing some research on SVN externals I thought of this...
trunk\project1\libs (external to trunk\libs @ some revision)
trunk\project2\libs (external to trunk\libs @ different revision)
trunk\libs\
I'm a little worried about how externals work with commits and not making library commits so complicated that I am the only one capable of doing it (mostly worried about branches with externals as we use them extensively).
On top of that we have multiple programming languages within each project some of which don't support per-project library directories (at least not easily) so we would need to check out on a per project basis instead of checking out the trunk.
There is also the 'vendor' style branching of libraries but it has the same problem as above where the library would have to be a sub folder of each project and is maybe a little to complicated for how little projects we have.
Any insight would be nice. I've spent quite a bit of time reading the Subversion book and feeling like I'm getting no where.
//
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// TODO Auto-generated method stub
switch(item.getItemId()) {
case EXIT:
try {
this.finish();
} catch(Exception e) {
}
break;
}
return false;
}
When I exit my android application it resumes the previous screen. How can I exit the Android application properly?
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'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.
(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.