Android Studio (wear + mobile) app in same project - android

I would like my android app to work in android wear too. I'm using android studio as IDE.
So what do I do for my app to work in android wear? Do I create another project? If so, will it share the same layouts and classes or will it be a whole other app? I mean, do I need to create two different apps for mobile and wear?

You need use Android Studio creates a new project with two modules, mobile and wear. You now have a project for both your handheld and wearable apps that you can create activities, services, custom layouts, and much more in. On the handheld app, you do most of the heavy lifting, such as network communications, intensive processing, or tasks that require long amounts of user interaction. When these are done, you usually notify the wearable of the results through notifications or by syncing and sending data to the wearable.
For more details, please refer to here.

Select and Go with the android wear activity and in the next window showing Configure your project, Check the Pair with Empty Phone App then it will automatically configure it for android phone and wear.

if you create a wear project, it automatically create "app" and "wear" modules. when you assemble, the wear APK gets embedded in the app APK. that's how it works.

old) In older versions of Android Studio you could select the different platforms for which a module was required during creation of the project.
new) In the current versions of Android Studio you have to just one platform and add the modules for additional platforms after creation of the project.
old)
new)

Related

How to manage development one app with multiple instances for Android and iOS?

I am working on a project where we have a product that we are selling to clients and basically it is same app with just different client logos, name and app color and some minor changes.
Let's say we have an app that creates a blog post. All of our clients are using this app and the only difference is that all apps have their own customer logos and color schema. It is hard to maintain multiple different projects and versions of apps. I mean if we have a new feature to implement or a bug fix, it is painful to copy code and put it in all apps and compile and generate APK files for Android and share it with clients.
It is also hard to deploy/create project when we get new client. Basically I am copying all project files, renaming directory and changing package name. I work on Android project, but we also have people working on iOS and it is same issue.
Is there any easy way to manage projects like this with some Android Studio feature and XCode feature? So for example, new feature of this app is allowing users to create post with uploading images so I write code for one Android app and push it to all apps and I can get APK files easily without opening multiple Android Studio projects?
Android Studio has support for multiple build types:
https://developer.android.com/studio/build/build-variants.html
Xcode can support multiple Targets:
https://developer.apple.com/library/content/featuredarticles/XcodeConcepts/Concept-Targets.html
With both you can use a shared codebase and depending on the build target/flavor/type, you simply use different assets, etc.
This would even let you configure certain apps with features enabled/disabled (assuming it's architectured well)

Android Studio: develop & debug Android app & AppEngine backend

Time has come to migrate to Android Studio from old good Eclipse...
My app has Android part and server part implemented on AppEngine.
The questions that I don't see direct answers to are:
1) Should it be 1 Project with 2 modules for Android and server parts, or 2 different Projects?
2) How can I debug them at the same time? I'm using REST, so on Eclipse I could in debug mode
.a) watch how http-request on Android's side is formed and just after that .b) see how it is processed on server's side.Can I do the same with Android Studio?
Will appreciate your advice & experience very much!Thanks!
1) The concept of workspace is a little different so in order to get them both working you should include them in the same AS project as different modules.
2) yes you are fully capable of launching the server in debug mode just like in eclipse.
Since AS is dedicated to Android Development, I would not migrate the server part of the app there. I have used the Google App Engine integration on Eclipse, and I am quite content with it. If you have to manage common dependencies between the two projects, this is a different question. Then, maybe, it would be best to not separate them at all.

Android Wear project - with an existing Android project

I have an existing Android app (for 4.2) written using Eclipse.
I'm exploring the possibility of adding an Android Wear component - there's part of the app which I think could work on a watch.
Reading through the docs at https://developer.android.com/training/building-wearables.html I'm unsure of what I'd need to do in order to integrate Wear into my existing project.
For example, under prerequisites it says Android Studio. Does that mean I'd need to migrate my Eclipse solution into Android Studio? Or can I build the Wear component independently?
Essentially, I'm just hoping to hear from someone who has added a Wear component to their existing Android solution so I can understand the basics of what's involved.
Android Wear is essentially very light application. The basic processing happens on the handheld device. Only user interaction functionalities such as accept, reject etc. is deplyed to the wear. Here also the processing is carried on by the handheld device.
So yes, you can include Wear to your project if it adds any value.

Delphi XE5 Firemonkey: Single code base for mobile/Win/OSX?

Just starting to play with FM after almost 20 years of VCL, so please bear with me... What makes an XE5 application mobile vs. FM HD?
I cannot add OSX target to a mobile project (even though Win32 works), and I cannot add iOS/Android target to a Win32/Win64/OSX project.
From what I can tell the same units are referenced, so why can't I have a single project for all supported platforms?
Thanks!
You cannot add desktop mobile target to mobile. The main reason, because desktop platform have more space of screen and has another ideom of building UI. So, of course, you can make window UI on mobile device, but it is not conveniently for using and doesn't respond mobile UI Guildline doc. Also Apple guaranteed doens't apply your application into App Store.
However, you can create two project with one code base.
Create Mobile project
Create Desktop project
Separate buisness logic from UI
You can create custom form for each projects or use exists (Only add your common form to mobile or desktop projects).
Thank you
I cannot add OSX target to a mobile project (even though Win32 works), and I cannot add iOS/Android target to a Win32/Win64/OSX project.
Different project types have different backend dependences. It does not make sense to allow OSX in a mobile project, so it is disabled. It does not make sense to allow iOS/Android in a desktop project, so they are disabled. The only reason Win32 is allowed in a mobile app is to help facilitate local testing without using a device/emulator, but you should not deploy without doing some device/emulator tests first.

Developing customized version of built-in SMS/MMS Android Application

Okay, here's the situation:
I'm developing an application for a client (or trying to do so). It requires much (if not all) of the same functionality as the built-in SMS/MMS application. So, I thought - HEY! Android is open source right? I can take the application and modify to my needs, right?
So, I found the code on github for the MMS/SMS application (for some reason, based on the AndroidManifest file, it calls my project I built, "ConversationList"). But I get TONS of errors involving the import com.google.android.mms.* package and a couple other packages.
Everyone keeps saying "it's a private/internal package", and "download the entire AOSP". But, HOW do I do this on Windows, and WHY can't I just download the appropriate packages to use in the program?
ALL I want to do is build a project in Eclipse deploy it to my phone, and then modify the necessary code. If Android is open source, why so many secret/internal packages? This is frustrating.
Any advice?
So, I found the code on github for the MMS/SMS application (for some reason, based on the AndroidManifest file, it calls my project I built, "ConversationList"). But I get TONS of errors involving the import com.google.android.mms.* package and a couple other packages.
AOSP applications like this are designed to be built as part of a firmware image, not as standalone apps.
But, HOW do I do this on Windows
Most likely, you don't. Cygwin might work. More likely, you will need to use OS X or Linux, such as running Linux in VirtualBox. And the result of your build will not run on anything, except as part of a firmware build that you use to replace the firmware on a device.
WHY can't I just download the appropriate packages to use in the program?
Because that application is designed to be built as part of a firmware image, not as a standalone app.
ALL I want to do is build a project in Eclipse deploy it to my phone, and then modify the necessary code.
Then find a project that is designed to be built as a standalone app as your starting point. Or, work on modifying the project you are trying to use to work as a standalone app, by ripping out all the functionality that depends upon things that are not in the app itself.
If Android is open source, why so many secret/internal packages?
They are not "secret". They are part of the firmware.
For example -- since you appear to be familiar with Windows -- it is entirely possible that "apps" like Control Panel are not designed to be built independently from the Windows OS. If you were able to download the source code to Windows and tried to load Control Panel into Visual Studio, it is eminently possible that you could not create some standalone CPANEL.EXE file just via that one project. Rather, you would need to use a customized Windows OS build process to build the whole OS, which would then contain a CPANEL.EXE that would run within that built version of the OS.
Most of the AOSP apps work this way. Some have been forked to create standalone apps -- K-9 Mail came from the early version of the AOSP email app. I have no idea if anyone has done this with the stock AOSP Messaging app or not.
You could instead fork TextSecure[0] as it is no system application but looks very similar to the stock messaging application. The AOSP application needs to be installed on /system/app which requires root and might not be what your customer wants.
Please note that this application is copylefted (GPLv3) so you'd have to give your client access to the source code under the terms of the GPL if you fork.
[0] https://github.com/WhisperSystems/TextSecure

Categories

Resources