0

I'm reading the code style from https://source.android.com/source/code-style.html it says:

Every file should have a copyright statement at the top

Then gives this example:

/*
 * Copyright (C) 2013 The Android Open Source Project 
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at 
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and 
 * limitations under the License.
 */

I realize they are probably talking about classes being added into AOSP, but I would like to put a copyright statement at the top of my own "private" files. What is recommended to enter as a copyright statement for my Android applications/classes/custom views? I would like to keep them private and not have them open source? I know this might come off as a sort of vague question, but copyright has always confused me. Appreciate any help on the topic.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
EGHDK
  • 17,818
  • 45
  • 129
  • 204

2 Answers2

2

The code style you're linking to is called:

Code Style Guidelines for Contributors

By definition, it's for people who make their code publicly available and want it contributed to the larger android open source project. These instructions really have nothing to do with you.

In your case, you'll compile your source files, and the pre-processor for your compiler will strip out any of those comments. So even if someone does reverse-engineer your code, that person won't have access to those comments even if they wanted to.

This is not to say that you shouldn't mark your files with copyright information, so that if one day, your laptop gets stolen, or you get into a legal dispute, or someone buys your project, or if a couple of years from now, you don't remember which files you wrote yourself or which one you copied from some place, etc. You should definitely do that, but for practical reasons, it may be easier to keep your project under version control and mark your entire project under your own copyright instead of doing it file by file especially if you're its sole author.

Stephan Branczyk
  • 9,363
  • 2
  • 33
  • 49
2

Eclips in Windows Menu Go to preferences -> Java -> Code Style -> Code Templates, expands Code and select “New Java Files”, then edit the template to add whatever copyright messages you want.

Now, that copyright message will be injected on every newly created Java class.

Prags
  • 2,457
  • 2
  • 21
  • 38