how to put apk in another apk and open it using intent? - java

i am working on a clock box app that contain several clock widgets the reason i want to put clocks in an another apk is its 30 clock for god sake its gets my phone widget manager force stop if i put all the clock codes in one apk. so i made 30 seperate clocks and now i stucked at the end how can i open them with package installer using intent?
the clocks are in assets folder and i just want to open them with package installer.
can any body teach me how to do it?
i am still learning so if you give me the whole code it would be great!
(my clint gets 403 so i cannat use google library)

Related

Android: Setting the location

I want the place picker from the google places API to basically start in a fixed location in the AVD. If I use google maps or place picker it tells me "unable to determine current location", both my wifi and gps are turned on. I know that in simulation you need to give a location.
I accessed the extended controls for the AVD and put in lat and long coordinates, I then click send, I believed this was how to send 1 location to a device. Doing this makes no changes to my devices location, what do I have to do to just send 1 location that google maps and place picker will always start from?
My extended controls:
And this is my place picker:
select this location is not the values I sent and it starts me at an incorrect location.
Six months ago when I was developing an app that used a score of Map related google services, the emulator was unable to utilize google-services. The consequence was that while I could add services, they would not function without the google-services library functioning on the AVD. In short 6 months ago there were no functional AVD images that allowed any google map/location services to work.
The solution (unfortunately) was to utilize physical android devices instead of the emulator. I don't know if there are still no AVD images that work with google-services - but you might want to start by checking if google-services functions with whatever AVD image you are using. If not - you may be out of luck.
Specifically - com.google.gms:google-services:3.0.0 (and any earlier version) did not work through the Android Studio emulator (AVD) 6 months ago.

Recieve constant updates from Google Drive API Android AppDataFolder?

I have created an Android application in which it is able to read files from the Google Drive Hidden AppData folder and react based on whether specific filenames are present.
I have created a separate external interface that creates a file in this folder and it seems to do it successfully.
The problem I have is that I can't seem to find a work around for having my android application constantly listening/receiving updates from the appdata folder.
The odd thing is, is that sometimes the application will pick up the file change straight away but other times it can take hours.
I'm convinced that Google's 'OnChangeSubscription' method they provide in the developer documentation doesn't actually work.
Any suggestions on methods I could try/where people have been successful at this would be great as I have been at it for weeks and it's the final thing I have left to do.

Eclipse to Android studio

So I have a project done which I made in Eclipse, I have also exported it as a Android and somehow imported it in Android Studio, But when I run the program in Android studio, it will execute as Java. And what I want to do is to make it execute in a Android phone (Can also be in a simulator)
But I have not found any tutorials on how to do it and I really need to do it since the essay is ending soon. So I would appreciate all help!
If more info needed, Please, Just comment. I will be available here next 2 hours!
The process should be quite simple if you have already succeeded in importing the project into Android Studio.
If you are using a Mac the process is very simple. If you are using Windows then there is one additional step described below:
In the AndroidManifest.xml make sure you have android:debuggable="true.
If you are using an Android phone with API 4.0+ then go into the phone's Settings and click on About Phone seven times. This might seem like a strange thing to do but it unlocks the phone's developer options, which are hidden by default. On older phones just go to Settings -> Applications -> Development.
In the Developer options select to allow USB debugging.
Now, connect the phone to the computer using a USB cable. You will probably see a message on the phone asking you to authorise the computer for that phone.
Next, open Android Studio and run your application (using the green triangle in the top toolbar). If the arrow is greyed-out then then there was a problem importing or building the project.
Wait while the project builds. It isn't that obvious that the project is being built. The only indication might be that there is a small spinner. If the build process succeeds you will see a prompt to choose a device. Your phone should be listed there. If it isn't, try disconnecting the phone from the USB and reconnecting it.
Select your phone, click OK and away you go. The application should launch on the phone after a few seconds. If it doesn't, be patient sometimes it takes a while. If it still doesn't work, check back in Android Studio for any errors.
Windows Only: Windows requires the additional step of installing the phone's drivers. Details can be found here http://developer.android.com/tools/extras/oem-usb.html

Pull files from Android tablet for debugging purposes.

In school (high school), my partner and I are developing an Android tablet application. We were both issued Acer Iconia A500 tablets to use. I need to pull files created by our application on run-time off the device (adb pull), but because they are not rooted, and I wouldn't want to root school property, is there an effective way to remove files from an android device stored in your applications data/data/packagename/ area? We also did try the emulator, but have had numerous different problems with it, and when it does work, it takes about 4-5 minutes to upload an apk to it every time I change code and re-upload it. Any ideas on a good way to get files off a non-rooted device, in this case a database I'm trying to copy from assets, so I can inspect it?
If you have a choice, I'd definitely recommend writing your files to the SD card because that will be a lot easier to view and handle.
If your file must necessarily be written in /data, what you could do is mirror it to the SD card for debugging purposes. So every time you write the file, you also write exactly the same content to the SD card (if the debug flag is on, otherwise no).
If it's a file that is not being created by your code but by other code, what you can do in your app is copy it to the SD card when you detect that it's been changed.
You could use the external storage permission and write to the SD Card instead. Then you can pull them using the regular windows directory when you plug it in. Also, it should not take that long to update your code via the emulator, are you turning the emulator off every time?

I have my android app compiling in an emulator, now what?

I going through a simple tutorial to create a very small android app in eclipse. The tutorial is here: http://mobile.tutsplus.com/tutorials/android/android-sdk-development/.
Now that I have it compiling, what should I do to get it on my phone? Do I need to export the app to some sort of exe? can i just copy and paste that exe into some "app" folder on my phone?
You may want to just follow these directions:
http://developer.android.com/guide/developing/device.html
Unless I need real-time debugging, I find it's pretty quick just to squirt the .apk at my phone and hit a few buttons to install and run it. I use Bluetooth which is fast and clean.
I have a file transfer utility for my PC's BT adapter and I simply 'push' the .apk file (from the bin directory) to my phone. Once received, I select it and it's automatically identified as an app package and I'm asked if I want to install it. Once installed I'm asked if I want to run it.
It's great when playing with samples/tutorials which (hopefully) should be bug-free and also when I'm playing around with layouts and UI elements in my own apps.

Categories

Resources